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

Error message could be more clear #3747

Open
p6rt opened this issue Mar 22, 2015 · 3 comments
Open

Error message could be more clear #3747

p6rt opened this issue Mar 22, 2015 · 3 comments
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Mar 22, 2015

Migrated from rt.perl.org#124141 (status was 'open')

Searchable as RT124141$

@p6rt
Copy link
Author

p6rt commented Mar 22, 2015

From @drforr

The core problem is that "Invalid typename", while *technically*
correct, isn't as helpful as it could be. It's invalid only because it's
not been imported into the file. At the time I figured that (bolstered
by the documentation) that 'use Bug​::Level​::Role' wasn't needed in perl6
as it could determine what class to import from the name. So I went off
on a wild goose chase for 30 minutes playing with the pathname and
filename before realizing "Oh, well, I guess I'll add the 'use'
declaration."

While I realize this is somewhat perl5-centric of me, this will be a
common programmer mistake (I know I've made it lots of times myself in
perl5,) and I feel there should be some explanatory text like "Invalid
typename (Maybe you forgot an 'use Bug​::Role' declaration?)" would be
helpful to get programmers back on track.

The other issues are that of documentation, mostly.

The 'use' keyword should be documented, entering it on
http://docs.perl.org/ only returns 'cause' as a function, which is
unhelpful.
At least one example in 'classtut' should contain a 'use' declaration -
all of the examples rely on inline class declarations, which is fine for
copypasta but not for real-world usage.
At least one example should contain a two-level package hierarchy, so
novice perl6 programmers get to see the '​::' in action. Those of us that
use perl5 know this, but it's not documented. Larry may own the colon,
but that doesn't mean we have to eliminate it from the documentation :)

The error text​:
--cut here--
===SORRY!=== Error while compiling
/home/jgoff/Documents/error/lib/Bug/Level/Zero.pm6
Invalid typename
at /home/jgoff/Documents/error/lib/Bug/Level/Zero.pm6​:3
------> class Bug​::Level​::Zero does Bug​::⏏Role {
  from t/01-basic.t​:2
--cut here--

rakudo version​:
--
commit d835c8e3d5810ad6c6efae3a52d377311ba32bb4
Author​: jnthn <jnthn@​jnthn.net>
Date​: Sat Mar 21 11​:52​:32 2015 +0100

t/01-basics.t​:
--cut here--
use v6;
use Bug​::Level​::Zero;
--cut here--

lib/Bug/Level/Zero.pm6​:
--cut here--
use v6;

class Bug​::Level​::Zero does Bug​::Role {
}
--cut here--

lib/Bug/Role.pm6​:
--cut here--
use v6;

role Bug​::Role {
}
--cut here--

@p6rt
Copy link
Author

p6rt commented May 20, 2016

From @smls

I'm not really sure I understand what this report is about.

Are you saying that you want

  class A does Foo {...}

to print an error message like the following in case `Foo` is not declared?

  Invalid typename 'Foo'
  Maybe you forgot a 'use Foo' declaration?

As for the p6doc issues, they should be reported to https://github.com/perl6/doc/issues.

@p6rt
Copy link
Author

p6rt commented May 20, 2016

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

@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