This looks good to me now:
$ perl6-m -e 'sub foo(::T $?) {}; say "alive"'
alive
$ perl6-m -e 'role A[::T $?] {}; class B does A[] {}; say "alive"'
alive
The following dies, but that's okay (from the IRC log above: "<TimToady> you
can't put ? on a type constraint, which ::T is parsed as").
$ perl6-m -e 'role A[::T?] {}; class B does A[] {}; say "alive"'
===SORRY!=== Error while compiling -e
Unable to parse expression in generic role; couldn't find final ']'
at -e:1
------> role A[::T⏏?] {}; class B does A[] {}; say "alive"
expecting any of:
statement list
prefix or term
prefix or meta-prefix
generic role
formal parameter
constraint
I'll add those three as tests and if nobody objects I'll close this ticket.