Skip Menu |
Report information
Id: 131339
Status: resolved
Priority: 0/
Queue: perl6

Owner: cpan [at] zoffix.com
Requestors: comdog <brian.d.foy [at] gmail.com>
Cc:
AdminCc:

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



Date: Sun, 21 May 2017 17:01:19 -0400
To: rakudobug [...] perl.org
From: brian d foy <brian.d.foy [...] gmail.com>
Subject: Pair.new uses positional parameters despite error message
Download (untitled) / with headers
text/plain 520b
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. Show quoted text
> my @array = <a b c>
[a b c] Show quoted text
> :@array
array => [a b c] Show quoted text
> my $pair = Pair.new: @array
Default constructor for 'Pair' only takes named arguments in block <unit> at <unknown file> line 1 Show quoted text
> my $pair = Pair.new: :a('b')
(Mu) => (Mu)
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 759b
On Sun, 21 May 2017 14:02:04 -0700, comdog wrote: Show quoted text
> 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)
Thank you for the report. This is now fixed. Fix: https://github.com/rakudo/rakudo/commit/1c16bf2e08 Test: https://github.com/perl6/roast/commit/a523aef60a


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