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
Variable return types cause an error #2707
Comments
From spidermario@free.frWith Rakudo 2012.03-53-g119fe3b (commit sub id(Any ::T $x) returns T { say id 42; with the following error message: Type check failed for return value ::T correctly contains Int, though. |
From @cokeOn Sun Apr 08 08:03:22 2012, spidermario@free.fr wrote:
Current behavior: $ cat a.pm say id 42; $ ./perl6 a.pm -- |
The RT System itself - Status changed from 'new' to 'open' |
From @gfldexsub foo(::T $t --> T){ T.new }; # OUTPUT«Type check failed for return value; expected T but got Int in |
From @skidsUpdated behavior: Though it should just work, now at least the error isn't LTA. $ perl6 -e 'sub id(Any ::T $x) returns T { $x }; say id 42;' $ perl6 -e 'sub id(Any ::T $x --> T) { $x }; say id 42;' $ perl6 -e 'sub id(Any ::T $x) of T { $x }; say id 42;' |
From @usev6On Mon Jan 18 06:00:47 2016, gfldex wrote:
As a status update: This looks somewhat worse now: $ ./perl6-m -e 'sub foo(::T $t --> T){ 45 }; my Int $i = 42; foo($i);' $ ./perl6-m --version |
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#112344 (status was 'open')
Searchable as RT112344$
The text was updated successfully, but these errors were encountered: