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

sub wrapped with mod_trait:<is> when exported yield cryptic error message, works fine in same unit #5618

Open
p6rt opened this issue Aug 26, 2016 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 26, 2016

Migrated from rt.perl.org#129096 (status was 'open')

Searchable as RT129096$

@p6rt
Copy link
Author

p6rt commented Aug 26, 2016

From ei@kefro.st

Tested on version 2016.07.1, 2016.08.1​:

When executing test2.pl, the error

Cannot invoke this object (REPR​: Null; VMNull)
  in block at (...)testimport.pm (testimport) line 7
  in any enter at gen/moar/m-Metamodel.nqp line 4012
  in block <unit> at test2.pl line 6

is displayed. When using the same code within the same file (i.e. without
an import of the wrapped sub), everything works as expected (i.e. output is

test, successfully wrapped
a

I asked about this in #perl6. It is not 100% clear that what I am trying to
do is supported​:

12​:25 < nine> ejf​: well you probably mean to export the wrapped sub but
that would mean that rakudo has to process the traits in the right way and
I'm not sure that's guaranteed. Could be that that's just a combination of
features
  that's not really feasible to support.
12​:26 < nine> ejf​: could also be just a plain straight forward bug in
rakudo :) I'm not familiar enough with that part to make a good guess and
am too tired to start debugging right now

(for reference, this also does not work if the trait_mod is part of an
exported class or is itself marked with "is export").

@p6rt
Copy link
Author

p6rt commented Aug 26, 2016

From ei@kefro.st

test2.pl

@p6rt
Copy link
Author

p6rt commented Aug 26, 2016

From ei@kefro.st

testimport.pm

@p6rt
Copy link
Author

p6rt commented Aug 27, 2016

From @LLFourn

This is another outer context lost with compile time closure bug. It's one
of the most prolific bugs in rakudo :(.

I've added this ticket to the list​:

https://rt.perl.org/Public/Bug/Display.html?id=125634
https://rt.perl.org/Public/Bug/Display.html?id=126818
https://rt.perl.org/Public/Bug/Display.html?id=127034
https://rt.perl.org/Public/Bug/Display.html?id=127112
https://rt.perl.org/Public/Bug/Display.html?id=127858
https://rt.perl.org/Public/Bug/Display.html?id=127860
https://rt.perl.org/Public/Bug/Display.html?id=127959
https://rt.perl.org/Public/Bug/Display.html?id=107844
https://rt.perl.org/Public/Bug/Display.html?id=128636
https://rt.perl.org/Public/Bug/Display.html?id=129096

On Sat, 27 Aug 2016 at 10​:04 AM, Eike Frost <perl6-bugs-followup@​perl.org>
wrote​:

# New Ticket Created by Eike Frost
# Please include the string​: [perl #​129096]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=129096 >

Tested on version 2016.07.1, 2016.08.1​:

When executing test2.pl, the error

Cannot invoke this object (REPR​: Null; VMNull)
in block at (...)testimport.pm (testimport) line 7
in any enter at gen/moar/m-Metamodel.nqp line 4012
in block <unit> at test2.pl line 6

is displayed. When using the same code within the same file (i.e. without
an import of the wrapped sub), everything works as expected (i.e. output is

test, successfully wrapped
a

I asked about this in #perl6. It is not 100% clear that what I am trying to
do is supported​:

12​:25 < nine> ejf​: well you probably mean to export the wrapped sub but
that would mean that rakudo has to process the traits in the right way and
I'm not sure that's guaranteed. Could be that that's just a combination of
features
that's not really feasible to support.
12​:26 < nine> ejf​: could also be just a plain straight forward bug in
rakudo :) I'm not familiar enough with that part to make a good guess and
am too tired to start debugging right now

(for reference, this also does not work if the trait_mod is part of an
exported class or is itself marked with "is export").

@p6rt
Copy link
Author

p6rt commented Aug 27, 2016

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

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant