Skip to content

Commit

Permalink
Don't use higher-level declares_method method
Browse files Browse the repository at this point in the history
It makes Attribute incompatible with Metamodel and other NQP classes via
a mixin.

`can` is to be avoided too because KnowHOW doesn't have it.
  • Loading branch information
vrurg committed Jul 30, 2020
1 parent 17f7f15 commit 1b5f6b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core.c/Attribute.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ my class Attribute { # declared in BOOTSTRAP
if self.has_accessor {
my str $name = nqp::unbox_s(self.name);
my $meth_name := nqp::substr($name, 2);
unless $package.^declares_method($meth_name) || $package.^has_multi_candidate($meth_name) {
unless nqp::existskey($package.^method_table, $meth_name)
|| nqp::existskey($package.^submethod_table, $meth_name)
|| (nqp::can($package.HOW, 'has_multi_candidate')
&& $package.^has_multi_candidate($meth_name))
{
my $dcpkg := nqp::decont($package);
my $meth;
my int $attr_type = nqp::objprimspec($!type);
Expand Down

0 comments on commit 1b5f6b9

Please sign in to comment.