Skip to content

Commit

Permalink
Fix canonicalize of RakuAST::ColonPair::True/False
Browse files Browse the repository at this point in the history
:D<True> and :U<True> don't really make sense in signatures
  • Loading branch information
lizmat committed Jan 29, 2023
1 parent 3a73a67 commit 775bdb2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Raku/ast/pair.rakumod
Expand Up @@ -115,6 +115,10 @@ class RakuAST::ColonPair::True is RakuAST::QuotePair {
$obj
}

method canonicalize() {
nqp::getattr(self, RakuAST::ColonPair, '$!key')
}

method PRODUCE-IMPLICIT-LOOKUPS() {
self.IMPL-WRAP-LIST([
RakuAST::Type::Setting.new(RakuAST::Name.from-identifier('Pair'))
Expand Down Expand Up @@ -150,6 +154,10 @@ class RakuAST::ColonPair::False is RakuAST::QuotePair {
$obj
}

method canonicalize() {
"!" ~ nqp::getattr(self, RakuAST::ColonPair, '$!key')
}

method PRODUCE-IMPLICIT-LOOKUPS() {
self.IMPL-WRAP-LIST([
RakuAST::Type::Setting.new(RakuAST::Name.from-identifier('Pair'))
Expand Down

0 comments on commit 775bdb2

Please sign in to comment.