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

"Cannot invoke object with invocation handler in this context" in CALL-ME on multi #5238

Open
p6rt opened this issue Apr 14, 2016 · 2 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 14, 2016

Migrated from rt.perl.org#127901 (status was 'new')

Searchable as RT127901$

@p6rt
Copy link
Author

p6rt commented Apr 14, 2016

From @jonathanstowe

If you try to provide the implementation of a multi method via a CALL-ME then invocation will give rise to "Cannot invoke object with invocation handler in this context". It is only necessary for the target method to be a multi not the CALL-ME.

This appears to be related to https://rt-archive.perl.org/perl6/Ticket/Display.html?id=122899 but I'm ticketing it separately as this is a more generalised case.

This will also afflict multi native subs it seems.

role Zub[​::T] {
  proto method CALL-ME(|c) { * }
  multi method CALL-ME(Mu​:D $self) {
  }
  multi method CALL-ME(Mu​:D $self, T $i) {
  }
}
multi sub trait_mod​:<is> (Method $m, :$foo!) is export {
  $m does Zub[Int];
}

class Foo {
  proto method bar(|c) { * }

  multi method bar() is foo {
  }
  multi method bar(Int $o) is foo {
  }
}

Foo.new.bar(1);

@p6rt
Copy link
Author

p6rt commented Jul 10, 2016

From @zoffixznet

Still present in 2016.06-154-g55c359e built on MoarVM version 2016.06-9-g8fc21d5

zoffix@​VirtualBox​:/tmp/tmp.g7rJ2YNub7$ perl6 p.pl
Cannot invoke object with invocation handler in this context
  in method bar at p.pl line 14
  in block <unit> at p.pl line 22

@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