Skip Menu |
Report information
Id: 130286
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: lucasbuchala <lucasbuchala [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Tue, 6 Dec 2016 23:07:38 -0200
To: rakudobug <rakudobug [...] perl.org>
From: Lucas Buchala <lucasbuchala [...] gmail.com>
Subject: Type capture doesn't capture inside comma lists
Download (untitled) / with headers
text/plain 1006b
Type capture in subroutine strangely works in some contexts but not others. Show quoted text
> sub f(::T) { say T }; f(10)
(Int) Show quoted text
> sub f(::T) { say (T,) }; f(10)
No such method 'gist' for invocant of type 'T' in sub f at - line 1 in block <unit> at - line 1 Show quoted text
> sub f(::T) { say (T.gist,) }; f(10)
((Int)) Show quoted text
> sub f(::T) { say [T] }; f(10)
[(Int)] Show quoted text
> sub f(::T) { say [T,] }; f(10)
No such method 'gist' for invocant of type 'T' in sub f at - line 1 in block <unit> at - line 1 It looks like it may has something to do with the handling of the comma operator. A superficial investigation shows that, "recently", only the release 2015.09 worked correctly, others before and after don't. I couldn't find the commit before 2015.09 that made things starting work. After 2015.09, bisectable6 pointed to this commit which introduced the error: https://github.com/rakudo/rakudo/commit/03f84eea11dc4b0c49d78844d2a8fac0981152a2 (Not sure if this is already reported; this may be a duplicate)
Something in optimizer.... the bug disappears with --optimize=off


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org