Skip Menu |
Report information
Id: 129096
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: ei [at] kefro.st
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Fri, 26 Aug 2016 14:44:42 +0200
From: Eike Frost <ei [...] kefro.st>
Subject: [BUG] sub wrapped with mod_trait:<is> when exported yield cryptic error message, works fine in same unit
To: rakudobug [...] perl.org
Download (untitled) / with headers
text/plain 1.1k
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"). 

Download test2.pl
text/x-perl 57b

Message body is not shown because sender requested not to inline it.

Download testimport.pm
text/x-perl 244b

Message body is not shown because sender requested not to inline it.

Subject: Re: [perl #129096] [BUG] sub wrapped with mod_trait:<is> when exported yield cryptic error message, works fine in same unit
To: bugs-bitbucket [...] rt.perl.org, perl6-compiler [...] perl.org
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
Date: Sat, 27 Aug 2016 00:26:18 +0000
Download (untitled) / with headers
text/plain 2.1k


On Sat, 27 Aug 2016 at 10:04 AM, Eike Frost <perl6-bugs-followup@perl.org> wrote:
Show quoted text
# 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.perl.org/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").


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org