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

Cryptic error when Array is parameterized with unknown type #5438

Closed
p6rt opened this issue Jul 8, 2016 · 4 comments
Closed

Cryptic error when Array is parameterized with unknown type #5438

p6rt opened this issue Jul 8, 2016 · 4 comments
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Jul 8, 2016

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

Searchable as RT128581$

@p6rt
Copy link
Author

p6rt commented Jul 8, 2016

From autark@gmail.com

The following statement​:

my Array[Numerix] $x;

produces this error message​:

===SORRY!=== Error while compiling ./x.pl6
An exception occurred while parameterizing Array
at ./x.pl6​:1
Exception details​:
  ===SORRY!=== Error while compiling
  Cannot invoke this object (REPR​: Null; VMNull)
  at :

It would be nice if it gave a message similar to when one misspells an
unparameterized type​:

Type 'Numerix' is not declared. Did you mean 'Numeric'?

@p6rt
Copy link
Author

p6rt commented Jul 21, 2016

From @jnthn

On Fri Jul 08 15​:13​:43 2016, pochi wrote​:

The following statement​:

my Array[Numerix] $x;

produces this error message​:

===SORRY!=== Error while compiling ./x.pl6
An exception occurred while parameterizing Array
at ./x.pl6​:1
Exception details​:
===SORRY!=== Error while compiling
Cannot invoke this object (REPR​: Null; VMNull)
at :

It would be nice if it gave a message similar to when one misspells an
unparameterized type​:

Type 'Numerix' is not declared. Did you mean 'Numeric'?

You can parameterize on more than types, so the error can't quite be that. But now it's very close​:

$ ./perl6-m -e 'my Array[Numerix] $x;'
===SORRY!=== Error while compiling -e
Undeclared name​:
  Numerix used at line 1. Did you mean 'Numeric'?

Test added to S32-exceptions/misc.t to make sure we don't regress on this in the future.

@p6rt
Copy link
Author

p6rt commented Jul 21, 2016

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

@p6rt
Copy link
Author

p6rt commented Jul 21, 2016

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

@p6rt p6rt closed this as completed Jul 21, 2016
@p6rt p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

1 participant