On Mon Apr 12 02:26:38 2010, moritz wrote:
> 11:07 <@moritz_> rakudo: class A { has $.a; multi method new ($){  } }; 
> say A.new(:a<b>).a
> 11:07 < p6eval> rakudo 0334df: OUTPUT«Any()␤»
> 11:08 <@moritz_> that bit me while writing Date.pm
> 11:08 <@moritz_> not sure if it's allowed by spec or not
> 11:08 < masak> er.
> 11:09 < masak> you're returning nothing from the method?
> 11:09 < masak> shouldn't you be getting Nil back?
> 11:09 <@moritz_> I'm not calling that method
> 11:09 < masak> ah, true.
> 11:09 <@moritz_> I think it's a bug
> 11:09 < masak> so do I.
> 11:09 <@moritz_> because either it finds the default method, then the 
> initialization should work
> 11:10 <@moritz_> or it doesn't find the method, then it should die horribly
> 11:10 < masak> aye.
> 11:10 < masak> seems kinda weird...
> 11:10 <@moritz_> rakudo: class A { has $.a }; say A.new(:a<b>).a
> 11:10 < masak> rakudo: class A { has $.a; multi method new ($){ say "OH 
> HAI" }}; say A.new(:a<b>)
> 11:10 < p6eval> rakudo 0334df: OUTPUT«b␤»
> 11:10 < p6eval> rakudo 0334df: OUTPUT«A()<0x5ebcbe8>␤»

This looks ok now:

19:36 <[Coke]> rakudo: class A { has $.a; multi method new ($){ } }; say
               A.new(:a<b>).a
19:36 <p6eval> rakudo ebd4d8: OUTPUT«b␤»
19:36 <[Coke]> rakudo: class A { has $.a }; say A.new(:a<b>).a
19:36 <p6eval> rakudo ebd4d8: OUTPUT«b␤»
19:36 <[Coke]> rakudo: class A { has $.a; multi method new ($){ say "OH HAI"
               }}; say A.new(:a<b>)
19:36 <p6eval> rakudo ebd4d8: OUTPUT«A<75415200>␤»

Closable modulo tests, I think.

-- 
Will "Coke" Coleda

Reply via email to