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

- BEGIN inside EXPORT::DEFAULT cannot invoke this object #4934

Open
p6rt opened this issue Dec 26, 2015 · 3 comments
Open

- BEGIN inside EXPORT::DEFAULT cannot invoke this object #4934

p6rt opened this issue Dec 26, 2015 · 3 comments
Labels

Comments

@p6rt
Copy link

@p6rt p6rt commented Dec 26, 2015

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

Searchable as RT127034$

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Dec 26, 2015

From @LLFourn

#lib/beginprecomp.pm
my package EXPORT​::DEFAULT {
  BEGIN {
  OUR​::{'&foo'} = sub (|) { say "foo" }
  }
}

perl6 -Ilib -e 'use beginprecomp; foo'
#!>Cannot invoke this object

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented May 3, 2016

From @salortiz

A golfed case of a closure with the same problem​:

MyTest.pm6​:
BEGIN { -> { note } }();

$ perl6 -I. -e 'use MyTest'
===SORRY!===
Cannot invoke this object

Some debugging shows that inside the closure, PROCESS​:: is null, and changing the code above to​:

BEGIN { temp PROCESS​::; -> { note } }()

made that survives precompilation.

1 similar comment
@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented May 3, 2016

From @salortiz

A golfed case of a closure with the same problem​:

MyTest.pm6​:
BEGIN { -> { note } }();

$ perl6 -I. -e 'use MyTest'
===SORRY!===
Cannot invoke this object

Some debugging shows that inside the closure, PROCESS​:: is null, and changing the code above to​:

BEGIN { temp PROCESS​::; -> { note } }()

made that survives precompilation.

@p6rt p6rt added the precomp label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.