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

'our'/package declaration with several variables gives bogus multiple declarations error in Rakudo #2594

Closed
p6rt opened this issue Dec 29, 2011 · 9 comments

Comments

@p6rt
Copy link

p6rt commented Dec 29, 2011

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

Searchable as RT107270$

@p6rt
Copy link
Author

p6rt commented Dec 29, 2011

From @masak

<masak> nom​: package Color { our ($red, $green, $blue) = 1..* }; say Color​::blue
<p6eval> nom a9bead​: OUTPUT«use of uninitialized value of type Mu in
string context␤use of uninitialized value of type Mu in string
context␤===SORRY!===␤error​:imcc​:Multiple declarations of lexical
'$green' [...]
<masak> o.O
* masak submits rakudobug
<masak> nom​: our ($r, $g)
<p6eval> nom a9bead​: OUTPUT«use of uninitialized value of type Mu in
string context␤use of uninitialized value of type Mu in string
context␤===SORRY!===␤error​:imcc​:Multiple declarations of lexical '$r'
[...]
<masak> oh my. :/
<flussence> nom​: our ($, $g)
<p6eval> nom a9bead​: OUTPUT«use of uninitialized value of type Mu in
string context␤use of uninitialized value of type Mu in string
context␤===SORRY!===␤error​:imcc​:Multiple declarations of lexical '$g'
[...]
<flussence> :D
<masak> nom​: our ($, $, $g)
<p6eval> nom a9bead​: OUTPUT«use of uninitialized value of type Mu in
string context␤use of uninitialized value of type Mu in string
context␤===SORRY!===␤error​:imcc​:Multiple declarations of lexical '$g'
[...]

All the above declarations should be kosher, IMO.

@p6rt
Copy link
Author

p6rt commented Dec 29, 2011

From kris@shannon.id.au

Caused by the $*W.mark_cur_lexpad_signatured(); in Perl6​::Actions​::signature.

@p6rt
Copy link
Author

p6rt commented Dec 29, 2011

From kris@shannon.id.au

On Thu Dec 29 12​:20​:41 2011, Kris.Shannon wrote​:

Caused by the $*W.mark_cur_lexpad_signatured(); in
Perl6​::Actions​::signature.

Umm, not exactly, but related to that in that our ($a, $b); tries to add them as parameters
to the current lexpad.

Modifying token declarator to use​:

'(' ~ ')' [ <.newpad> <signature> { $*W.pop_lexpad() } ] <trait>*

fixes the problem, but I'm not sure that's the right answer.

@p6rt
Copy link
Author

p6rt commented Dec 29, 2011

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

@p6rt
Copy link
Author

p6rt commented Jul 3, 2012

From @ronaldxs

Some other simple current one liner examples with similar error symptoms
include​:

our ($a) = 1

and

(our ($a))

@p6rt
Copy link
Author

p6rt commented Jul 23, 2012

From @ronaldxs

As noted for golf on IRC July 22 and recommended by jnthn++

our ($x)

is enough to yeild the same symptoms.

@p6rt
Copy link
Author

p6rt commented Nov 5, 2012

From @jnthn

On Mon Jul 23 12​:03​:45 2012, ronaldxs wrote​:

As noted for golf on IRC July 22 and recommended by jnthn++

our ($x)

is enough to yeild the same symptoms.

Fixed​:

our ($x);
Any()
our ($x, $y) = 1, 2; say $x; say $y;
1
2

Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented May 9, 2013

From @FROGGS

added test​:
Raku/roast@354e16c

<FROGGS> nrp​: package Color { our ($red, $green, $blue) = 1..* }; say
$Color​::blue
<camelia> rakudo fe7049, niecza v24-42-g69a3432​: OUTPUT«3␤»
<camelia> ..pugs​: OUTPUT«␤»

@p6rt
Copy link
Author

p6rt commented May 9, 2013

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

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