Skip to content
Permalink
Browse files

Make Scalar.WHICH return a ValueObjAt

  • Loading branch information...
lizmat committed Dec 28, 2018
1 parent 9df0962 commit 0d29768adf45a12ce18a670fc8091ab4a45f63de
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/core/Scalar.pm6
@@ -5,8 +5,14 @@ my class Scalar { # declared in BOOTSTRAP

method new(|) { X::Cannot::New.new(class => self.WHAT).throw }

multi method WHICH(Scalar:D:) {
'Scalar|' ~ nqp::objectid($!descriptor);
multi method WHICH(Scalar:D: --> ValueObjAt:D) {
nqp::box_s(
nqp::concat(
'Scalar|',
nqp::tostr_I(nqp::objectid($!descriptor))
),
ValueObjAt
)
}
method name() {
my $d := $!descriptor;

0 comments on commit 0d29768

Please sign in to comment.
You can’t perform that action at this time.