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

method reference causes Null PMC #1991

Closed
p6rt opened this issue Jul 31, 2010 · 6 comments
Closed

method reference causes Null PMC #1991

p6rt opened this issue Jul 31, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Jul 31, 2010

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

Searchable as RT76882$

@p6rt
Copy link
Author

p6rt commented Jul 31, 2010

From @gfldex

use v6;

class A {
  method b(){ say 'butterfly'; };
};

my $a = A.new();
my $method_ref = $a.^can('b');
$method_ref($a);

sub foo($o, $m){
  $m($o);
};

foo($a, $method_ref);

--

butterfly
Null PMC access in invoke()
  in 'foo' at line 1​:method_reference.p6
  in 'foo' at line 11​:method_reference.p6
  in main program body at line 15​:method_reference.p6

@p6rt
Copy link
Author

p6rt commented Aug 12, 2010

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

@p6rt
Copy link
Author

p6rt commented Oct 3, 2011

From @coke

On Sat Jul 31 14​:20​:52 2010, wenzel.peppmeyer@​gmx.de wrote​:

use v6;

class A {
method b(){ say 'butterfly'; };
};

my $a = A.new();
my $method_ref = $a.^can('b');
$method_ref($a);

sub foo($o, $m){
$m($o);
};

foo($a, $method_ref);

--

butterfly
Null PMC access in invoke()
in 'foo' at line 1​:method_reference.p6
in 'foo' at line 11​:method_reference.p6
in main program body at line 15​:method_reference.p6

This no longer generates an NPA​:

Method 'postcircumfix​:<( )>' not found for invocant of class 'Parcel'
  in <anon> at src/gen/Metamodel.pm​:3164
  in block <anon> at foo​:9
  in <anon> at foo​:1

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented May 30, 2013

From @coke

On Mon Oct 03 11​:48​:33 2011, coke wrote​:

On Sat Jul 31 14​:20​:52 2010, wenzel.peppmeyer@​gmx.de wrote​:

use v6;

class A {
method b(){ say 'butterfly'; };
};

my $a = A.new();
my $method_ref = $a.^can('b');
$method_ref($a);

sub foo($o, $m){
$m($o);
};

foo($a, $method_ref);

--

butterfly
Null PMC access in invoke()
in 'foo' at line 1​:method_reference.p6
in 'foo' at line 11​:method_reference.p6
in main program body at line 15​:method_reference.p6

This no longer generates an NPA​:

Method 'postcircumfix​:<( )>' not found for invocant of class 'Parcel'
in <anon> at src/gen/Metamodel.pm​:3164
in block <anon> at foo​:9
in <anon> at foo​:1

... And is therefore (still) closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Sep 12, 2013

From @moritz

Now tested here​:

commit 03d12d694ada66d45ca04e26ac089035b8d0f72b
Author​: Moritz Lenz <moritz@​faui2k3.org>
Date​: Thu Sep 12 21​:43​:50 2013 +0200

  RT #​76882​: calling methods with sub call syntax outside the class

S12-introspection/can.t | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

@p6rt
Copy link
Author

p6rt commented Sep 12, 2013

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

@p6rt p6rt closed this as completed Sep 12, 2013
@p6rt p6rt added the testneeded 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
Development

No branches or pull requests

1 participant