Skip Menu |
Report information
Id: 124141
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: drforr [at] pobox.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



From: drforr [...] pobox.com
Date: Sun, 22 Mar 2015 10:45:32 +0100
To: Rakudobug <rakudobug [...] perl.org>
Subject: Error message could be more clear
Download (untitled) / with headers
text/plain 2.1k
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--
Download (untitled) / with headers
text/plain 358b
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.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org