# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #119427]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=119427 >


<timotimo> r: sub test(@a[10]) { say +@a }; test((1, 2, 3, 4, 5, 6, 7,
8, 9, 10))
<camelia> rakudo e7ce6b: OUTPUT«Constraint type check failed for
parameter '' in sub-signature of parameter @a [...]
<timotimo> i got nothin'
<masak> timotimo: that doesn't mean what you think it means.
<masak> r: sub test(@a [10]) { say "it's alive!" }; test([10])
<camelia> rakudo e7ce6b: OUTPUT«it's alive!␤»
<TimToady> masak: @a[10] is supposed to mean something different than @a [10]
<masak> TimToady: that may be. it clearly doesn't in Rakudo ;)
<jnthn> r: sub foo(@a[10]) { }; foo([10])
<camelia> rakudo e7ce6b:  ( no output )
<jnthn> r: sub foo(@a[10]) { }; foo([9])
<camelia> rakudo e7ce6b: OUTPUT«Constraint type check failed for
parameter '' in sub-signature of parameter @a [...]
<jnthn> hm :)
<TimToady> it's not parsing it as a shape
<jnthn> aye, I don't think it expects to parse a shape there... :P
<jnthn> Does STD? What does it mean to parse a shape there? :)
<TimToady> I can think of two interpretation
<TimToady> one, a constraint on what you can pass in
<TimToady> secondly, one might allow @a[$size] to bind $size to the
size, but that's a little there, and probably a bad idea
<jnthn> pobably ;)
<TimToady> STD parses it as a shape
<TimToady> in any case, the syntax @a[] should be reserved for
shape-related declarations, not treated as a subbinding
<TimToady> anyway, if we let people write subbinding with @a[], people
will, and then their code will break later when we require whitespace;
so better to require it now

Reply via email to