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
Rakudo chokes in the wrong way when the name of a type is used before it's declared #905
Comments
From @masak<masak> rakudo: say B; grammar B {} Same symptom when we declare a class or role. When we declare a |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S10-packages/basic.t commit d756d92e13c3450abb5caf40b3c0aab251a9bbf4 [t/spec] Tests for RT #64828 Inline Patchdiff --git a/t/spec/S10-packages/basic.t b/t/spec/S10-packages/basic.t
index 9fe31ed..15c6d21 100644
--- a/t/spec/S10-packages/basic.t
+++ b/t/spec/S10-packages/basic.t
@@ -4,7 +4,7 @@ use v6;
use Test;
-plan 32;
+plan 42;
regex fairly_conclusive_platform_error {:i ^\N*<<Null?>>}
@@ -76,6 +76,34 @@ lives_ok {package A1 { role B1 {}; class C1 does A1::B1 {}} },
'since role is in package should not need package name';
}
+{
+ my $x;
+
+ eval '$x = RT64828g; grammar RT64828g {}';
+ ok $! ~~ Exception, 'reference to grammar before definition dies';
+ #?rakudo todo 'RT #64828'
+ ok "$!" ~~ / RT64828g /, 'error message mentions the undefined grammar';
+
+ eval '$x = RT64828m; module RT64828m {}';
+ ok $! ~~ Exception, 'reference to module before definition dies';
+ #?rakudo todo 'RT #64828'
+ ok "$!" ~~ / RT64828m /, 'error message mentions the undefined module';
+
+ eval '$x = RT64828r; role RT64828r {}';
+ ok $! ~~ Exception, 'reference to role before definition dies';
+ #?rakudo todo 'RT #64828'
+ ok "$!" ~~ / RT64828r /, 'error message mentions the undefined role';
+
+ eval '$x = RT64828c; class RT64828c {}';
+ ok $! ~~ Exception, 'reference to class before definition dies';
+ ok "$!" ~~ / RT64828c /, 'error message mentions the undefined class';
+
+ eval '$x = RT64828p; package RT64828p {}';
+ ok $! ~~ Exception, 'reference to package before definition dies';
+ #?rakudo todo 'RT #64828'
+ ok "$!" ~~ / RT64828p /, 'error message mentions the undefined package';
+}
+
#?rakudo todo 'ticket based on class(es) not package; RT #65022'
{
eval_lives_ok '{ |
The RT System itself - Status changed from 'new' to 'open' |
From @jnthnOn Sat Apr 18 08:48:15 2009, masak wrote:
Now more helpful, and the tests are passed that were added to this Thanks, Jonathan |
@jnthn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#64828 (status was 'resolved')
Searchable as RT64828$
The text was updated successfully, but these errors were encountered: