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

Strange error: "Found named parameter '(unnamed)' twice in signature" #6519

Open
p6rt opened this issue Sep 14, 2017 · 1 comment
Open

Strange error: "Found named parameter '(unnamed)' twice in signature" #6519

p6rt opened this issue Sep 14, 2017 · 1 comment

Comments

@p6rt
Copy link

p6rt commented Sep 14, 2017

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

Searchable as RT132089$

@p6rt
Copy link
Author

p6rt commented Sep 14, 2017

From @zoffixznet

This code throws this error, even though I don't seem to be using two unnamed named params​:

  $ perl6 -e 'role Foo { multi method x(​:$x) { "role" } }; class :​: does Foo { multi method x(​:$) { "class" } }.new.x.say'
  ===SORRY!=== Error while compiling -e
  Found named parameter '(unnamed)' twice in signature :(<anon|83252608> $​: $, *%_)​: *%_ vs $
  at -e​:1
 
Even thought pretty much any other combination of args or avoiding of role mixing does not have this error​:

  $ perl6 -e 'class Foo { method x(​::?CLASS​:D​: :$) { "class" } }.new.x.say'
  class
  $ perl6 -e 'class Foo { method x(​:$) { "class" } }.new.x.say'
  class
  $ perl6 -e 'class Foo { multi method x(​:$) { "class" } }.new.x.say'
  class
  $ perl6 -e 'role Foo { multi method x(​:$x) { "role" } }; class :​: does Foo { multi method x(​::?CLASS​:D​: :$) { "class" } }.new.x.say'
  class
  $ perl6 -e 'role Foo { multi method x() { "role" } }; class :​: does Foo { multi method x(​:$) { "class" } }.new.x.say'
  class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant