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 with "need 6"/"use 6" (no "v") #4760

Open
p6rt opened this issue Nov 18, 2015 · 4 comments
Open

error with "need 6"/"use 6" (no "v") #4760

p6rt opened this issue Nov 18, 2015 · 4 comments
Labels
LHF Low-hanging fruit, easy to resolve LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Nov 18, 2015

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

Searchable as RT126669$

@p6rt
Copy link
Author

p6rt commented Nov 18, 2015

From spam-bitcard@yary.ack.org

When Rakudo (MoarVM) 6.b encounters
  need 6.000;
or
  use 6.000;

it gives an error​:

  Undeclared routine​:
  use (or "need")

I encountered this as a Perl5-ism, where I may say "use 5.022" so that ancient Perls won't choke on "v5.22" - can we get one of those awesome error messages that says "do you mean 'need v6.0'?" when given the above?

Also,
  use "foo";

also gives same LTA "Undeclared routine​: use" error, would be nice if it told use how to use a module from an interpolated string instead.

thanks!

@p6rt
Copy link
Author

p6rt commented Oct 3, 2017

From @AlexDaniel

See https://github.com/rakudo/rakudo/blob/f946bd35dca39af97983ec95d4da7fdd0416b73d/src/core/Exception.pm#L1025-L1031

It seems that you can add “need” and “use” there (with a good message) and it will do exactly what was requested.

On 2015-11-17 18​:57​:53, fecund wrote​:

When Rakudo (MoarVM) 6.b encounters
need 6.000;
or
use 6.000;

it gives an error​:

Undeclared routine​:
use (or "need")

I encountered this as a Perl5-ism, where I may say "use 5.022" so that
ancient Perls won't choke on "v5.22" - can we get one of those awesome
error messages that says "do you mean 'need v6.0'?" when given the
above?

Also,
use "foo";

also gives same LTA "Undeclared routine​: use" error, would be nice if
it told use how to use a module from an interpolated string instead.

thanks!

@p6rt
Copy link
Author

p6rt commented Oct 3, 2017

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

@p6rt
Copy link
Author

p6rt commented Oct 3, 2017

@p6rt p6rt added LHF Low-hanging fruit, easy to resolve LTA Less Than Awesome; typically an error message that could be better labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LHF Low-hanging fruit, easy to resolve LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

1 participant