Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
evaluate argument list for compile time role application instead of w…
…hining that it is not known

tanzdebil++ for bringing it to my attention
  • Loading branch information
moritz committed Jul 20, 2012
1 parent b15d33b commit 81328c3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Perl6/World.pm
Expand Up @@ -1206,16 +1206,18 @@ class Perl6::World is HLL::World {
my @pos_args;
my %named_args;
for @($arglist[0].ast) {
unless $_<has_compile_time_value> {
$/.CURSOR.panic("Cannot use '" ~ $arglist[0].Str ~
"' as an argument to a parametric role as its value is not " ~
"known at compile time");
my $val;
if $_<has_compile_time_value> {
$val := $_<compile_time_value>;
}
else {
$val := self.compile_time_evaluate($/, $_);
}
if $_.named {
%named_args{$_.named} := $_<compile_time_value>;
%named_args{$_.named} := $val;
}
else {
@pos_args.push($_<compile_time_value>);
@pos_args.push($val);
}
}

Expand Down

0 comments on commit 81328c3

Please sign in to comment.