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

LTA error message when declaring an only sub 'foo' after declaring a variable &foo in Rakudo #2225

Closed
p6rt opened this issue Oct 14, 2010 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Oct 14, 2010

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

Searchable as RT78370$

@p6rt
Copy link
Author

p6rt commented Oct 14, 2010

From @masak

<moritz_> rakudo​: my &foo; sub foo { };
<p6eval> rakudo 5d23e3​: OUTPUT«===SORRY!===␤Can not re-declare sub
&foo without declaring it multi at line 22, near ";"␤»
<masak> rakudo​: my &foo; multi foo { }
<p6eval> rakudo 5d23e3​: OUTPUT«===SORRY!===␤Multiple declarations of
lexical '&foo'␤␤»
<masak> but you said...? :/
<moritz_> :-)
* masak submits LTA rakudobug
<masak> std​: my &foo; sub foo { }
<p6eval> std 263c207​: OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m␤Illegal
redeclaration of routine 'foo' (see line 1) [...] FAILED 00​:01 119m␤»

Note how, in not mentioning "without declaring it multi", STD.pm6
avoids leading the user down a false track in this particular case.

@p6rt
Copy link
Author

p6rt commented May 29, 2012

From @moritz

Now dies with Method 'is_dispatcher' not found for invocant of class
'Any'␤». Still LTA, but probably not too hard to fix.

@p6rt
Copy link
Author

p6rt commented May 29, 2012

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

@p6rt
Copy link
Author

p6rt commented Jun 9, 2013

From @jnthn

On Thu Oct 14 05​:47​:29 2010, masak wrote​:

<moritz_> rakudo​: my &foo; sub foo { };
<p6eval> rakudo 5d23e3​: OUTPUT«===SORRY!===␤Can not re-declare sub
&foo without declaring it multi at line 22, near ";"␤»
<masak> rakudo​: my &foo; multi foo { }
<p6eval> rakudo 5d23e3​: OUTPUT«===SORRY!===␤Multiple declarations of
lexical '&foo'␤␤»
<masak> but you said...? :/
<moritz_> :-)
* masak submits LTA rakudobug
<masak> std​: my &foo; sub foo { }
<p6eval> std 263c207​: OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m␤Illegal
redeclaration of routine 'foo' (see line 1) [...] FAILED 00​:01
119m␤»

Note how, in not mentioning "without declaring it multi", STD.pm6
avoids leading the user down a false track in this particular case.

Rakudo no longer does, and the error for "my &foo; multi foo() { }" is
now the correct one. Unskipped a test for this in S32-exceptions/misc.t;
resolving.

/jnthn

@p6rt p6rt closed this as completed Oct 6, 2014
@p6rt
Copy link
Author

p6rt commented Oct 6, 2014

@usev6 - 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