Permalink
Browse files

Make a real pad etc. for a signature literal, to prevent various thin…

…gs exploding in nasty ways.
  • Loading branch information...
1 parent 16f22b8 commit dca2ab53775a96219a03a1da52a5e753b0507eec @jnthn jnthn committed Sep 25, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −1 src/Perl6/Actions.pm
  2. +0 −2 src/Perl6/Grammar.pm
@@ -2746,10 +2746,15 @@ class Perl6::Actions is HLL::Actions {
}
method fakesignature($/) {
+ my $fake_pad := $*W.pop_lexpad();
my %sig_info := $<signature>.ast;
my @params := %sig_info<parameters>;
set_default_parameter_type(@params, 'Mu');
- my $sig := create_signature_object($/, %sig_info, $*FAKE_PAD, :no_attr_check(1));
+ my $sig := create_signature_object($/, %sig_info, $fake_pad, :no_attr_check(1));
+
+ $*W.cur_lexpad()[0].push($fake_pad);
+ $*W.create_code_object($fake_pad, 'Block', $sig);
+
make QAST::WVal.new( :value($sig) );
}
@@ -1742,10 +1742,8 @@ grammar Perl6::Grammar is HLL::Grammar {
}
token fakesignature {
- :my $*FAKE_PAD;
<.newpad>
<signature>
- { $*FAKE_PAD := $*W.pop_lexpad() }
}
token signature {

0 comments on commit dca2ab5

Please sign in to comment.