skids/perl6sum

`where` block assignment in signature won't compile

Closed this issue · 1 comments

There appears to be quite a few roles that do role[:$var where {$something} = $bar]. This does not appear to work:

nickl@localhost:~/perl6$ perl6 -e 'role foo[$x where {$_ == True} = True] { say 1; }; role foo[$x where {$_ == True} = False] { say 2; }; class Bar does foo[True] { }; Bar.new'
===SORRY!===
No appropriate parametric role variant available for 'foo'

Replacing {$cond} = True/False with *.so/not in Sum::MD and Sum::Tiger allowed the precompile stage to finish successfully. This causes it to fail some tests, so i'm not sure if it really fixes anything or if the tests need to be tweaked.

For example:

nickl@localhost:~/perl6$ perl6 -e 'role foo[$x where *.so] { say 1; }; role foo[$x where *.not] { say 2; }; class Bar does foo[True] { }; Bar.new'
1

This should be fixed with jnthn++'s preclim fix, but I did push some workarounds for older installs.
(Before the fix, you can get the parser to DTRT by adding a newline before the default value.)