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

need with version silently fails #6567

Open
p6rt opened this issue Oct 3, 2017 · 2 comments
Open

need with version silently fails #6567

p6rt opened this issue Oct 3, 2017 · 2 comments
Labels
LHF Low-hanging fruit, easy to resolve testneeded

Comments

@p6rt
Copy link

p6rt commented Oct 3, 2017

Migrated from rt.perl.org#132214 (status was 'new')

Searchable as RT132214$

@p6rt
Copy link
Author

p6rt commented Oct 3, 2017

From @zoffixznet

If you `use` a v6.d, it causes language switch and will also complain if the version is too high.
The same doesn't happen with `need`. It should probably fail in these cases, and `<version>` should
be just removed from the grammar[^1].

15​:26 m​: need v6.c
15​:26 camelia rakudo-moar f946bd​: ( no output )
15​:27 Zoffix m​: need v6.e
15​:27 camelia rakudo-moar f946bd​: ( no output )
15​:32 Zoffix m​: need v6.d; say $*PERL.version
15​:32 camelia rakudo-moar f946bd​: OUTPUT​: «v6.c␤»

[1] https://github.com/rakudo/rakudo/blob/f946bd35dca39af97983ec95d4da7fdd0416b73d/src/Perl6/Grammar.nqp#L1548

@p6rt
Copy link
Author

p6rt commented Oct 27, 2018

From @zoffixznet

On Tue, 03 Oct 2017 08​:34​:39 -0700, cpan@​zoffix.com wrote​:

If you `use` a v6.d, it causes language switch and will also complain
if the version is too high.
The same doesn't happen with `need`. It should probably fail in these
cases, and `<version>` should
be just removed from the grammar[^1].

15​:26 m​: need v6.c
15​:26 camelia rakudo-moar f946bd​: ( no output )
15​:27 Zoffix m​: need v6.e
15​:27 camelia rakudo-moar f946bd​: ( no output )
15​:32 Zoffix m​: need v6.d; say $*PERL.version
15​:32 camelia rakudo-moar f946bd​: OUTPUT​: «v6.c␤»

[1]
https://github.com/rakudo/rakudo/blob/f946bd35dca39af97983ec95d4da7fdd0416b73d/src/Perl6/Grammar.nqp#L1548

This appears to be fixed now​:

<Zoffix__> m​: need v6.d
<camelia> rakudo-moar e7e91ecfb​: OUTPUT​: «===SORRY!=== Error while compiling <tmp>␤In case of using pragma, use "use" instead (e.g., "use v6;", "use v6.c;").␤at <tmp>​:1␤------> need v6.d⏏<EOL>␤»

@p6rt p6rt added LHF Low-hanging fruit, easy to resolve testneeded 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 testneeded
Projects
None yet
Development

No branches or pull requests

1 participant