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
Null PMC Access when calling a sub &foo with a parameter &foo defaulting to &foo in Rakudo #1174
Comments
From @masak<masak> rakudo: sub foo(&foo = &foo) { say "OH HAI"; foo }; foo |
From @jnthnOn Mon Jul 27 08:11:54 2009, masak wrote:
It now lives: 00:30 <@jnthn> rakudo: sub foo(&foo = &foo) {}; foo Since the &foo inside the sub is a new lexical variable, you essentially 00:30 <@jnthn> rakudo: sub foo(&foo = &foo) {say &foo}; foo Anyway, it's what I'd expect. Giving to moritz++ for spectest. Thanks, Jonathan |
The RT System itself - Status changed from 'new' to 'open' |
From @moritzTested in S06-signature/code.t. |
@moritz - Status changed from 'open' to 'resolved' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S06-signature/code.t commit 6d18247f0f0e02ee8084016b843522245cc6c5bb [t/spec] test for RT #67932 Inline Patchdiff --git a/t/spec/S06-signature/code.t b/t/spec/S06-signature/code.t
index 9a54662..733970b 100644
--- a/t/spec/S06-signature/code.t
+++ b/t/spec/S06-signature/code.t
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 6;
+plan 8;
# TODO: move this test to closure-parameters.t if it works in the future
@@ -37,4 +37,15 @@ is tester2({ 'block' }), 1, 'Can pass a block to a ¶meter';
"Can't pass something that isn't typed as returning Callable";
}
+# RT #67932
+{
+ my $tracker;
+ sub foo(&foo = &foo) {
+ $tracker = &foo
+ };
+ lives_ok { foo },
+ 'can call a sub with a code object defaulting to something of its own name';
+ ok !$tracker.defined, 'the inner &foo is undefined (scoping)';
+}
+
# vim: ft=perl6 |
Migrated from rt.perl.org#67932 (status was 'resolved')
Searchable as RT67932$
The text was updated successfully, but these errors were encountered: