Skip to content

Commit

Permalink
Fix role parameterization over generics
Browse files Browse the repository at this point in the history
When parameterization is taking place over a generic it must be done at
run-time.

Make the following code work as expected:

```
role A[::T] {
    method a { A[T] }
}
say A[Int].a ~~ A[Int];
```
  • Loading branch information
vrurg committed Aug 25, 2022
1 parent f66d576 commit 94f3028
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Perl6/Actions.nqp
Expand Up @@ -6576,8 +6576,11 @@ class Perl6::Actions is HLL::Actions does STDActions {
my $ast := $<arglist>.ast;
wantall($past, 'name');
for @($ast) {
unless $_.has_compile_time_value {
if !$_.has_compile_time_value
|| (my $value_type := nqp::what($_.compile_time_value)).HOW.archetypes($value_type).generic
{
$all_compile_time := 0;
last;
}
}
if $all_compile_time {
Expand Down

0 comments on commit 94f3028

Please sign in to comment.