Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

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

Open p6rt opened 8 years ago

p6rt commented 8 years ago

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

Searchable as RT126669$

p6rt commented 8 years ago

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 commented 7 years ago

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 commented 7 years ago

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

p6rt commented 7 years ago

From @zoffixznet

Probably just needs to be added to the list here​: https://github.com/rakudo/rakudo/blob/f946bd35dca39af97983ec95d4da7fdd0416b73d/src/core/Exception.pm#L1025-L1031