Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:D on attrs and vars fails with a defined default value #4628

Closed
p6rt opened this issue Oct 8, 2015 · 4 comments
Closed

:D on attrs and vars fails with a defined default value #4628

p6rt opened this issue Oct 8, 2015 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 8, 2015

Migrated from rt.perl.org#126291 (status was 'resolved')

Searchable as RT126291$

@p6rt
Copy link
Author

p6rt commented Oct 8, 2015

From @TimToady

22​:28 < TimToady> m​: say class { has Int​:D $.foo is default(0) }.new
22​:29 <+camelia> rakudo-moar 472ea0​: OUTPUT«===SORRY!=== Error while
compiling /tmp/WV7JjqRYN7␤Variable definition of type Int​:D requires an
  initializer␤at /tmp/WV7JjqRYN7​:1␤------> class { has
Int​:D $.foo is default(0) ⏏}.new␤ expecting any of​:␤
  constraint␤»
22​:29 < TimToady> I don't think that one should require an initializer
22​:29 -!- coetry [~allen@​c-50-171-35-243.hsd1.tx.comcast.net] has quit
[Quit​: Lost terminal]
22​:29 -!- allen [~allen@​c-50-171-35-243.hsd1.tx.comcast.net] has quit
[Quit​: Lost terminal]
22​:30 < TimToady> m​: my Int​:D $x is default(0);
22​:30 <+camelia> rakudo-moar 472ea0​: OUTPUT«===SORRY!=== Error while
compiling /tmp/p5BBLy48x8␤Default value '0' will never bind to a
  parameter of type Int​:D␤at /tmp/p5BBLy48x8​:1␤------> my
Int​:D $x is default(0)⏏;␤ expecting any of​:␤ constraint␤»
22​:30 < TimToady> say wot?
22​:31 < TimToady> is that one bug or two?
22​:32 < TimToady> m​: my Int​:D @​array is default(0); @​array[0] = Nil;
22​:32 <+camelia> rakudo-moar 472ea0​: OUTPUT«===SORRY!=== Error while
compiling /tmp/MpVmByHAQM␤Default value '0' will never bind to a
  parameter of type Array[Int​:D]␤at
/tmp/MpVmByHAQM​:1␤------> my Int​:D @​array is default(0)⏏; @​array[0] =
Nil;␤ expecting
  any of​:␤ co…»
22​:33 < TimToady> two and a half?

@p6rt
Copy link
Author

p6rt commented Oct 10, 2015

From @FROGGS

Patch​: rakudo/rakudo@80a3d07235
Tests​: Raku/roast@071720b28d

Closing ticket.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 10, 2015

From @FROGGS

Patch​: rakudo/rakudo@80a3d07235
Tests​: Raku/roast@071720b28d

Closing ticket.

@p6rt p6rt closed this as completed Oct 10, 2015
@p6rt
Copy link
Author

p6rt commented Oct 10, 2015

@FROGGS - Status changed from 'new' to 'resolved'

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant