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

Pair.new uses positional parameters despite error message #6259

Closed
p6rt opened this issue May 21, 2017 · 4 comments
Closed

Pair.new uses positional parameters despite error message #6259

p6rt opened this issue May 21, 2017 · 4 comments

Comments

@p6rt
Copy link

p6rt commented May 21, 2017

Migrated from rt.perl.org#131339 (status was 'resolved')

Searchable as RT131339$

@p6rt
Copy link
Author

p6rt commented May 21, 2017

From @briandfoy

I was playing with Pair and found this odd error message that says
the default constructor only takes named arguments. While .new can
take named arguments, it doesn't do anything iwth them. It does
construct a Pair from positional parameters though.

  > my @​array = <a b c>
  [a b c]
  > :@​array
  array => [a b c]
  > my $pair = Pair.new​: @​array
  Default constructor for 'Pair' only takes named arguments
  in block <unit> at <unknown file> line 1

  > my $pair = Pair.new​: :a('b')
  (Mu) => (Mu)

@p6rt
Copy link
Author

p6rt commented May 21, 2017

From @zoffixznet

On Sun, 21 May 2017 14​:02​:04 -0700, comdog wrote​:

I was playing with Pair and found this odd error message that says
the default constructor only takes named arguments. While .new can
take named arguments, it doesn't do anything iwth them. It does
construct a Pair from positional parameters though.

> my @&#8203;array = \<a b c>
\[a b c\]
> :@&#8203;array
array => \[a b c\]
> my $pair = Pair\.new&#8203;: @&#8203;array
Default constructor for 'Pair' only takes named arguments
  in block \<unit> at \<unknown file> line 1

> my $pair = Pair\.new&#8203;: :a\('b'\)
\(Mu\) => \(Mu\)

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@1c16bf2e08
Test​: Raku/roast@a523aef60a

@p6rt
Copy link
Author

p6rt commented May 21, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt closed this as completed May 21, 2017
@p6rt
Copy link
Author

p6rt commented May 21, 2017

@zoffixznet - Status changed from 'open' to 'resolved'

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