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

Things that are not SixModelObjects leak out of BEGIN blocks which end with a require in Rakudo #2809

Closed
p6rt opened this issue Jul 2, 2012 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Jul 2, 2012

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

Searchable as RT113956$

@p6rt
Copy link
Author

p6rt commented Jul 2, 2012

From @masak

<harmil> r​: BEGIN { require Test }
<p6eval> rakudo 16db64​: OUTPUT«===SORRY!===␤Can only use
nqp_set_sc_for_object with a SixModelObject␤»
<harmil> r​: BEGIN { require Test;1 }
<p6eval> rakudo 16db64​: ( no output )
<jnthn> masak may file a Rakudo bug about it too ;)
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Jul 2, 2012

From @pmichaud

I'm guessing the bug is that 'require' (without an expression) ends up
directly returning the module object from ModuleLoader.load_module. If
the 'require' is given an expression of symbols to import, then the code
also generates a call to &REQUIRE_IMPORT, which looks up the loaded
module in the namespace and returns that. That approach seems to work
okay.

  pmichaud@​kiwi​:~/p6/rakudo$ ./perl6
  > say BEGIN { require Test <&is>; }
  Test()
  > say BEGIN { require Test; }
  Can only use nqp_set_sc_for_object with a SixModelObject
  >

Pm

@p6rt
Copy link
Author

p6rt commented Jul 2, 2012

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Aug 5, 2012

From @jnthn

On Mon Jul 02 15​:49​:06 2012, masak wrote​:

<harmil> r​: BEGIN { require Test }
<p6eval> rakudo 16db64​: OUTPUT«===SORRY!===␤Can only use
nqp_set_sc_for_object with a SixModelObject␤»
<harmil> r​: BEGIN { require Test;1 }
<p6eval> rakudo 16db64​: ( no output )
<jnthn> masak may file a Rakudo bug about it too ;)
* masak submits rakudobug

Fixed​:

perl6 -Ilib -e "BEGIN { require Test }"
(no output)

Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented Jan 15, 2014

From @coke

On Sun Aug 05 09​:45​:23 2012, jnthn@​jnthn.net wrote​:

On Mon Jul 02 15​:49​:06 2012, masak wrote​:

<harmil> r​: BEGIN { require Test }
<p6eval> rakudo 16db64​: OUTPUT«===SORRY!===␤Can only use
nqp_set_sc_for_object with a SixModelObject␤»
<harmil> r​: BEGIN { require Test;1 }
<p6eval> rakudo 16db64​: ( no output )
<jnthn> masak may file a Rakudo bug about it too ;)
* masak submits rakudobug

Fixed​:

perl6 -Ilib -e "BEGIN { require Test }"
(no output)

Tagging testneeded.

/jnthn

Switched S11-modules/require.t to use this construct to load Test.pm.

Closing ticket.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 15, 2014

@coke - 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