Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Enforce SSA on sigilless in my (\x, \y) = 1, 2;.
  • Loading branch information
jnthn committed Dec 16, 2015
1 parent eac2b86 commit f303efc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Perl6/Actions.nqp
Expand Up @@ -2670,6 +2670,7 @@ Compilation unit '$file' contained the following violations:
my $list := QAST::Op.new( :op('call'), :name('&infix:<,>') );
my @params := $<signature>.ast<parameters>;
my $common_of := $*OFTYPE;
my @nosigil;
for @params {
my $*OFTYPE := $common_of;
if nqp::existskey($_, 'of_type') && nqp::existskey($_, 'of_type_match') {
Expand All @@ -2687,6 +2688,9 @@ Compilation unit '$file' contained the following violations:
$_<desigilname>, $<trait>);
unless $past.isa(QAST::Op) && $past.op eq 'null' {
$list.push($past);
if $_<sigil> eq '' {
nqp::push(@nosigil, ~$_<desigilname>);
}
}
}
else {
Expand All @@ -2707,6 +2711,18 @@ Compilation unit '$file' contained the following violations:
$/.CURSOR.panic("Cannot assign to a list of 'has' scoped declarations")
if $*SCOPE eq 'has';
$list := assign_op($/, $list, $initast);
if @nosigil {
$list := QAST::Stmts.new( :resultchild(0), $list );
for @nosigil {
$list.push(QAST::Op.new(
:op('bind'),
QAST::Var.new( :name($_), :scope('lexical') ),
QAST::Op.new(
:op('p6recont_ro'),
QAST::Var.new( :name($_), :scope('lexical') )
)));
}
}
}
elsif $<initializer><sym> eq '.=' {
$/.CURSOR.panic("Cannot use .= initializer with a list of declarations");
Expand All @@ -2729,6 +2745,9 @@ Compilation unit '$file' contained the following violations:
$list, $orig_list);
}
}
elsif @nosigil {
$/.CURSOR.typed_panic('X::Syntax::Term::MissingInitializer');
}

make $list;
}
Expand Down

0 comments on commit f303efc

Please sign in to comment.