Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/Inline/Perl5/ClassHOW.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class Inline::Perl5::ClassHOW
},
].FLATTENABLE_LIST;

method destroyers(Mu \type) {
method destroyers(Mu $XXX?) {
$destroyers
}

Expand Down Expand Up @@ -426,11 +426,11 @@ class Inline::Perl5::ClassHOW
meth
}

method declares_method(Mu $type, $name) {
method declares_method(Mu $XXX, $name) {
%!cache{$name}:exists
}

method method_table(Mu $type) is raw {
method method_table(Mu $XXX?) is raw {
use nqp;
my class NQPHash is repr('VMHash') {
method Map() {
Expand All @@ -446,12 +446,12 @@ class Inline::Perl5::ClassHOW
result
}

method submethod_table(Mu $type) is raw {
method submethod_table(Mu $XXX?) is raw {
use nqp;
nqp::hash()
}

method methods(Mu $type, :$local, :$excl, :$all) {
method methods(Mu $XXX?, :$local, :$excl, :$all) {
$local ?? @!local_methods !! %!cache.values
}

Expand All @@ -462,7 +462,7 @@ class Inline::Perl5::ClassHOW
return False;
}

method accepts_type(Mu $, Mu \check) {
method accepts_type(Mu $XXX, Mu \check) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/'XXX'/'XXX?'/?

(And presumably for lang_rev_before method too.)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first positional arg cannot be optional if the second is mandatory. So they would have to become both optional.

I vaguely remember (the PR is from almost 2 years ago, you know) there was a specific reason for these not to become optional, probably because it always gets called with 2 arguments?

return False;
}

Expand Down Expand Up @@ -597,7 +597,7 @@ class Inline::Perl5::ClassHOW
self.add_method($type, $name, $proto)
}

method lang-rev-before(Mu \type, $rev) {
method lang-rev-before(Mu $XXX, $rev) {
1
}
}
Expand Down