Skip to content

Commit

Permalink
RakuAST: give slurpy placeholder params a fixed order in the signature
Browse files Browse the repository at this point in the history
The old frontend added slurpy placeholder parameters to the signature in
the order of appearance in the block. At least one spectest relied on
this. In general we need compilation results to be reproducible.
However, we go through placeholders in hash order. That's not a problem
because positionals will be sorted lexicographically anyway. It was
a problem for slurpies, so just always add @_ before %_.
  • Loading branch information
niner committed Jan 29, 2023
1 parent 1072872 commit bab7f83
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Raku/ast/code.rakumod
Expand Up @@ -541,7 +541,12 @@ class RakuAST::PlaceholderParameterOwner
@nameds.push($placeholder);
}
else {
@slurpies.push($placeholder);
if $placeholder.lexical-name eq '@_' { # @_ before %_
@slurpies.unshift($placeholder);
}
else {
@slurpies.push($placeholder);
}
}
}

Expand Down

0 comments on commit bab7f83

Please sign in to comment.