Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type capture doesn't capture inside comma lists #5868

Open
p6rt opened this issue Dec 7, 2016 · 2 comments
Open

Type capture doesn't capture inside comma lists #5868

p6rt opened this issue Dec 7, 2016 · 2 comments

Comments

@p6rt
Copy link

p6rt commented Dec 7, 2016

Migrated from rt.perl.org#130286 (status was 'new')

Searchable as RT130286$

@p6rt
Copy link
Author

p6rt commented Dec 7, 2016

From lucasbuchala@gmail.com

Type capture in subroutine strangely works in some contexts but not others.

  > sub f(​::T) { say T }; f(10)
  (Int)

  > 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

  > sub f(​::T) { say (T.gist,) }; f(10)
  ((Int))

  > sub f(​::T) { say [T] }; f(10)
  [(Int)]

  > 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​:
rakudo/rakudo@03f84ee

(Not sure if this is already reported; this may be a duplicate)

@p6rt
Copy link
Author

p6rt commented Dec 11, 2016

From @zoffixznet

Something in optimizer.... the bug disappears with --optimize=off

@p6rt p6rt added the optimizer label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant