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
Should be able to fail() from a upper-case-return-type-constrained sub in Rakudo #941
Comments
From @masak<cspencer> rakudo: our Int sub foo() { return fail() }; foo() |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S04-exceptions/fail.t commit 36252e8d1ee13f5a26aff7620bb65035f9d99a4e [t/spec] Test for RT #64990 Inline Patchdiff --git a/t/spec/S04-exceptions/fail.t b/t/spec/S04-exceptions/fail.t
index d9dcd1c..b91d860 100644
--- a/t/spec/S04-exceptions/fail.t
+++ b/t/spec/S04-exceptions/fail.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 4;
+plan 5;
# L<S04/Exceptions/The fail function>
@@ -31,4 +31,11 @@ plan 4;
is $was_after_sub, 0, "fail() causes our try{} to die";
}
+# RT #64990
+{
+ our Int sub rt64990 { return fail() }
+ #?rakudo skip 'RT #64990'
+ ok rt64990() ~~ Failure, 'sub typed Int can return Failure';
+}
+
# vim: ft=perl6 |
The RT System itself - Status changed from 'new' to 'open' |
From @jnthnOn Wed Apr 22 09:57:06 2009, masak wrote:
Fixed in git 352acd2 and tests unfudged. Thanks, Jonathan |
@jnthn - Status changed from 'open' to 'resolved' |
@moritz - Status changed from 'resolved' to 'open' |
From @moritzIn nom, prefix and --> return type constraints weren't implemented for |
From @cokeOn Fri Aug 31 12:10:54 2012, moritz wrote:
Currently failure mode of tests: 14:21 < [Coke]> r: our Int sub foo { fail('a') }; say foo() ~~ Failure -- |
From @cokeOn Fri Mar 29 11:23:03 2013, coke wrote:
This is now failing in a way very similar to the original bug report: $ ./perl6-m -e 'our Int sub foo() { return fail() }; foo()' -- |
From @peschwaOn Mon Feb 16 22:11:44 2015, coke wrote:
Failure has been special-cased in p6typecheckrv to always match type checks in Rakudo commit f1fa6445d8c7b46010443dcabed709aef150b78f. As mentioned in the commit message, jnthn++ has some concerns about inlineability of subs, but I can't see what to change how exactly. Roast commits f1fa6445d8c7b46010443dcabed709aef150b78f corrects a few tests that expect X::TypeCheck::Return to check for the now correct X::Numeric::DivideByZero instead, while f6461b3eca27c1a873b545ee23a04a327094c73 unfudges the existing tests in S04-exceptions/fail.t. |
From @usev6On Tue Jun 23 02:43:41 2015, peschwa@gmail.com wrote:
I'm closing this ticket as 'resolved'. |
@usev6 - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#64990 (status was 'resolved')
Searchable as RT64990$
The text was updated successfully, but these errors were encountered: