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
Putting a 'use' statement inside a method causes Rakudo to emit a confused error about not being in a class #1639
Comments
From @masak$ cat A.pm $ cat B.pm method foo() { $ perl6 B.pm I'm assuming that the above should work. (It does in alpha, and in Perl 5.) |
From @jnthnOn Mon Mar 29 08:41:18 2010, masak wrote:
Fixed; given to moritz++ for spectests. Thanks, Jonathan |
The RT System itself - Status changed from 'new' to 'open' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S10-packages/use-with-class.t commit d8944e8b6eac93f4cace32bbc6588b0d323b0320 [t/spec] Test for RT #73886, loading a class from inside a method Inline Patchdiff --git a/t/spec/S10-packages/use-with-class.t b/t/spec/S10-packages/use-with-class.t
index e2b7801..ec664bf 100644
--- a/t/spec/S10-packages/use-with-class.t
+++ b/t/spec/S10-packages/use-with-class.t
@@ -5,7 +5,7 @@ use Test;
# L<S11/Compile-time Importation>
-plan 7;
+plan 8;
# test that 'use' imports class names defined in importet packages
@@ -32,4 +32,18 @@ eval_lives_ok 'Stupid::Class.new()', 'can instantiate object of "imported" class
}
+# class loading inside a method
+# RT #73886
+{
+ BEGIN { @*INC.push: 't/spec/packages' }
+ class MethodLoadingTest {
+ method doit {
+ use Foo;
+ Foo.new.foo();
+ }
+ }
+ is MethodLoadingTest.doit(), 'foo', 'can load class from inside a method';
+
+}
+
# vim: ft=perl6 |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#73886 (status was 'resolved')
Searchable as RT73886$
The text was updated successfully, but these errors were encountered: