On Sun Nov 29 02:54:14 2015, pesc...@gmail.com wrote: > On Fri Sep 04 09:13:10 2015, masak wrote: > > <masak_venue> m: sub foo( Str &b:(Bool --> Int) ) { say "alive" }; > > foo( sub (Bool) { 42 } ) > > <camelia> rakudo-moar e6f360: OUTPUT«Type check failed in binding &b; > > expected 'Callable[Str]' but got 'Sub' in sub foo at > > /tmp/fBPFLs3lWv:1 in block <unit> at /tmp/fBPFLs3lWv:1» > > * masak_venue submits rakudobug > > <jnthn> masak_venue: Wait, why? > > <masak_venue> (it ignores the inner/Int return type directive) > > <jnthn> Oh... > > <masak_venue> I think it should fail by forbidding doubly declaring > > it > > like that > > <jnthn> Yeah, there's precedent for trying to catch such thinkos > > <masak_venue> jnthn: yes, lichtkind did it by mistake and didn't even > > realize. > > <jnthn> m: my Int foo() returns Str { } > > <camelia> rakudo-moar e6f360: OUTPUT«===SORRY!===Type 'Int' is not > > declared. Did you mean 'int'?at /tmp/FG3lZlDRBh:1------> my Int > > ⏏foo() returns Str { }Malformed myat /tmp/FG3lZlDRBh:1------> my > > Int ⏏foo() returns Str { }» > > <masak_venue> it would be nice to catch it and throw the perfect > > error > > message > > <jnthn> m: my Int sub foo() returns Str { } > > <camelia> rakudo-moar e6f360: OUTPUT«===SORRY!=== Error while > > compiling /tmp/RNk5jWh_lGRedeclaration of return type for foo > > (previous return type was Int)at /tmp/RNk5jWh_lG:1» > > <jnthn> Something like that > > <masak_venue> yes, that one > > As of Rakudo commit bb931c8fd this behaves as follows: > > 10:45 <psch> m: sub f(Int &b:(--> Str)) { } > 10:45 <camelia> rakudo-moar ff81e9: OUTPUT«===SORRY!=== Error while > compiling /tmp/Dv68JuR7BqRedeclaration of return type for &b:(--> > Str) > (previous return type was Int )at > /tmp/Dv68JuR7Bq:1------> sub f(Int &b:(--> Str)⏏) { }» > > This has been added as a test to roast in commit 6af57be0.
Which means we can resolve this issue. Thanks!