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 trying to declare an attribute in a package in Rakudo #2938

Closed
p6rt opened this issue Oct 19, 2012 · 6 comments
Closed
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 19, 2012

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

Searchable as RT115362$

@p6rt
Copy link
Author

p6rt commented Oct 19, 2012

From @masak

<masak> r​: package X { has $.foo }
<p6eval> rakudo d171b9​: OUTPUT«Error while constructing error
object​:Could not locate compile-time value for symbol
Attribute​::Package [...]
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Jan 11, 2013

From @jnthn

On Fri Oct 19 12​:33​:45 2012, masak wrote​:

<masak> r​: package X { has $.foo }
<p6eval> rakudo d171b9​: OUTPUT�Error while constructing error
object​:Could not locate compile-time value for symbol
Attribute​::Package [...]
* masak submits rakudobug

Note that it's calling the package X that is immediately to blame for
the LTA error; it hides the setting's X package which contains all of
the exception types.

/jnthn

@p6rt
Copy link
Author

p6rt commented Jan 11, 2013

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

@p6rt
Copy link
Author

p6rt commented Oct 7, 2014

From @usev6

To me the error message looks good now (with 'package Y')​:

$ perl6-m -e 'package Y { has $.foo }'
===SORRY!=== Error while compiling -e
A package cannot have attributes, but you tried to declare '$.foo'
at -e​:1
------> package Y { has $.foo ⏏}
  expecting any of​:
  scoped declarator
  constraint

It throws a typed exception "X​::Attribute​::Package". I added a test to S32-exceptions/misc.t with the following commit​: Raku/roast@47f209b

The remaining question is what to do with 'package X'. As jnthn pointed out, this one is special since it contains all the exception types.

@p6rt
Copy link
Author

p6rt commented Apr 8, 2015

From @jnthn

On Tue Oct 07 13​:53​:39 2014, bartolin@​gmx.de wrote​:

To me the error message looks good now (with 'package Y')​:

$ perl6-m -e 'package Y { has $.foo }'
===SORRY!=== Error while compiling -e
A package cannot have attributes, but you tried to declare '$.foo'
at -e​:1
------> package Y { has $.foo ⏏}
expecting any of​:
scoped declarator
constraint

It throws a typed exception "X​::Attribute​::Package". I added a test to
S32-exceptions/misc.t with the following commit​:
Raku/roast@47f209b

The remaining question is what to do with 'package X'. As jnthn
pointed out, this one is special since it contains all the exception
types.

That's a separate issue from this ticket, though; the issue the ticket was really about (and probably golfed from) is resolved.

@p6rt p6rt closed this as completed Apr 8, 2015
@p6rt
Copy link
Author

p6rt commented Apr 8, 2015

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

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant