Skip to content

Commit

Permalink
Work around "Cannot invoke this object (REPR: Null; VMNull)"
Browse files Browse the repository at this point in the history
Code blocks in nested scopes may lose access to subroutines in the lexical
scope if run at BEGIN time. Work around this in CompUnit::Repository::Perl5
so we can still get precompilation support until the rakudobug is fixed.
  • Loading branch information
niner committed Oct 13, 2019
1 parent 573f6a2 commit 4df02fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core.c/CompUnit/Repository/Perl5.pm6
Expand Up @@ -5,8 +5,8 @@ class CompUnit::Repository::Perl5 does CompUnit::Repository {
--> CompUnit:D)
{
if $spec.from eq 'Perl5' {
require Inline::Perl5;
my $perl5 = ::('Inline::Perl5').default_perl5;
my $compunit = $*REPO.need(CompUnit::DependencySpecification.new(:short-name<Inline::Perl5>));
my $perl5 := $compunit.handle.globalish-package<Inline>.WHO<Perl5>.default_perl5;

if $*RAKUDO_MODULE_DEBUG -> $RMD {
$RMD("Loading {$spec.short-name} via Inline::Perl5");
Expand Down

0 comments on commit 4df02fa

Please sign in to comment.