# New Ticket Created by  "Brian S. Julin" 
# Please include the string:  [perl #123623]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=123623 >



Trying to compose a role that has a named parameter, when that
parameter has both a where clause and a default value, will
fail multi selection unless there is a newline before the
"=" introducing the default value.  This is replicatable
a lot of the time but I could swear I saw some heisenbuggy
behavior relating to whether it was tried on -e, and whether
it was precomp.

In addition, 'where { } = default' causes a different error
when used on subroutine signatures.

This on Star 2014-12, but ugexe++ also verified on newer:

# cat /tmp/A.pm6
 
role A [ :$bs where { True } = 512] { }
# PERL6LIB=/tmp/ perl6-m -e 'use A; class B does A[ ] { }; B.new;'
===SORRY!===
None of the parametric role variants for 'A' matched the arguments supplied.
Cannot modify an immutable Block
# emacs /tmp/A.pm6
# cat /tmp/A.pm6
role A [ :$bs where { True }
= 512] { }
# PERL6LIB=/tmp/ perl6-m -e 'use A; class B does A[ ] { }; B.new;'
#

For the subroutine signature problem, see:

http://irclog.perlgeek.de/perl6/2015-01-19#i_9964933

Reply via email to