Skip to content

Commit

Permalink
Remove dead code for use v5
Browse files Browse the repository at this point in the history
Dies while complaining about missing `Perl5` module. A thought occured
to make it load Inline::Perl5, but felt like useless magic, so I
removed the code entirely and just make it complain there's no
compiler for v5, like it'd do for `use v6.z`

Fixes RT#130834: https://rt.perl.org/Ticket/Display.html?id=130834
  • Loading branch information
zoffixznet committed Oct 7, 2017
1 parent cb9d2e0 commit 4868e92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/Perl6/Grammar.nqp
Expand Up @@ -1607,11 +1607,6 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
# we parse out the numeral, since we could have "6c"
:my $version := nqp::radix(10,$<version><vnum>[0],0,0)[0];
[
|| <?{ $version == 5 }> {
my $module := $*W.load_module($/, 'Perl5', {}, $*GLOBALish);
$*W.do_import($/, $module, 'Perl5');
$*W.import_EXPORTHOW($/, $module);
}
|| <?{ $version == 6 }> {
my $version_parts := $<version><vnum>;
my $vwant := $<version>.ast.compile_time_value;
Expand Down
3 changes: 3 additions & 0 deletions t/05-messages/01-errors.t
Expand Up @@ -225,6 +225,9 @@ subtest '`IO::Socket::INET.new: :listen` fails with useful error' => {
like $res.exception.message, /'Invalid port'/, 'error mentions port';
}

throws-like use v5, X::Language::Unsupported,
'`use v5` in code does not try to load non-existent modules';

done-testing;

# vim: ft=perl6 expandtab sw=4

0 comments on commit 4868e92

Please sign in to comment.