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

Importing sub using require causes Null PMC access #3162

Closed
p6rt opened this issue Jun 10, 2013 · 9 comments
Closed

Importing sub using require causes Null PMC access #3162

p6rt opened this issue Jun 10, 2013 · 9 comments

Comments

@p6rt
Copy link

p6rt commented Jun 10, 2013

Migrated from rt.perl.org#118407 (status was 'resolved')

Searchable as RT118407$

@p6rt
Copy link
Author

p6rt commented Jun 10, 2013

From dagurval@pvv.ntnu.no

say slurp("/tmp/a.pm6")
sub abc() is export { say "hello" }

This works (given that it's NYI)

require("/tmp/a.pm6") "&abc";
abc();
Trying to import symbols &abc from '/tmp/a.pm6', but it does not export
anything

Without the ampersand however,

require("/tmp/a.pm6") "abc"; abc();
Error while compiling block (source text​: "require(\"/tmp/a.pm6\")
\"abc\"; abc();\n")​: Error while compiling op call​: Error while compiling
block : Error while compiling op call​: Null PMC access in
find_method('handle')

@p6rt
Copy link
Author

p6rt commented Nov 18, 2014

From @usev6

I can't reproduce the Null PMC access anymore​:

$ cat 118407.pm6
sub abc() is export { say "hello" }

$ perl6-p

require("118407.pm6") "&abc"; abc();
Trying to import symbols &abc from '118407.pm6', but it does not export anything

require("118407.pm6") "abc"; abc();
Trying to import symbols abc from '118407.pm6', but it does not export anything

Output for perl6-m and perl6-j is similar.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Nov 18, 2014

From @usev6

I can't reproduce the Null PMC access anymore​:

$ cat 118407.pm6
sub abc() is export { say "hello" }

$ perl6-p

require("118407.pm6") "&abc"; abc();
Trying to import symbols &abc from '118407.pm6', but it does not export anything

require("118407.pm6") "abc"; abc();
Trying to import symbols abc from '118407.pm6', but it does not export anything

Output for perl6-m and perl6-j is similar.

@p6rt
Copy link
Author

p6rt commented Nov 18, 2014

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 27, 2016

From @LLFourn

This "mssing symbols" error on the first example will be fixed when​:
rakudo/rakudo#694
is merged.

Skipped test will be removed with​:
LLFourn/roast@6865ca6

@p6rt
Copy link
Author

p6rt commented Jan 27, 2016

From @LLFourn

errr what I meant to say is that is the second example

require "/tmp/a.pm6" "abc"; abc();

is not meant to work so I'm removing the test. You need the &abc is the
name of the symbol so that's what needs to be there.

On Wed, Jan 27, 2016 at 9​:42 PM Lloyd Fournier <lloyd.fourn@​gmail.com>
wrote​:

This "mssing symbols" error on the first example will be fixed when​:
rakudo/rakudo#694
is merged.

Skipped test will be removed with​:

LLFourn/roast@6865ca6

@p6rt
Copy link
Author

p6rt commented Aug 17, 2016

From @coke

On Mon Jun 10 00​:32​:33 2013, dagurval wrote​:

say slurp("/tmp/a.pm6")
sub abc() is export { say "hello" }

This works (given that it's NYI)

require("/tmp/a.pm6") "&abc";
abc();
Trying to import symbols &abc from '/tmp/a.pm6', but it does not export
anything

Without the ampersand however,

require("/tmp/a.pm6") "abc"; abc();
Error while compiling block (source text​: "require(\"/tmp/a.pm6\")
\"abc\"; abc();\n")​: Error while compiling op call​: Error while compiling
block : Error while compiling op call​: Null PMC access in
find_method('handle')

This now works, and is closable with tests.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Sep 11, 2016

From @zoffixznet

Tests added in Raku/roast@cda0cb3ed9

@p6rt
Copy link
Author

p6rt commented Sep 11, 2016

@zoffixznet - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant