Skip to content

Commit

Permalink
Make CompUnit::PrecompilationId a proper Value Type
Browse files Browse the repository at this point in the history
Now that CompUnit::PrecompilationIds are no longer cached, it must
be a proper value type to make things like .unique and QuantHashes
work correctly.
  • Loading branch information
lizmat committed Mar 10, 2020
1 parent 778ce37 commit 1a0cc94
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core.c/CompUnit/PrecompilationUnit.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ class CompUnit::PrecompilationId {
CompUnit::PrecompilationId,'$!id',$id)
}

multi method WHICH(CompUnit::PrecompilationId:D: --> ValueObjAt:D) {
nqp::box_s(
nqp::concat('CompUnit::PrecompilationId|',$!id),
ValueObjAt
)
}

method Str() { $!id }
method IO() { $!id.IO }
method substr(|c) { $!id.substr(|c) }
Expand Down

0 comments on commit 1a0cc94

Please sign in to comment.