Skip to content

Commit

Permalink
Correct (Set|SetHash).perl
Browse files Browse the repository at this point in the history
An empty Set/SetHash was shown as "Set()"/"SetHash()", which would
create a Set/SetHash with Any as the only element when EVALled.
  • Loading branch information
lizmat committed Oct 29, 2017
1 parent 3c4041e commit af3624d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/core/Setty.pm
Expand Up @@ -158,16 +158,16 @@ my role Setty does QuantHash {
)
}
multi method perl(Setty:D $ : --> Str:D) {
nqp::concat(
nqp::if(
nqp::eqaddr(self,set()),
'set()',
nqp::concat(
nqp::if(
nqp::istype(self,Set),
'set(',
nqp::concat(self.^name,'(')
),
nqp::join(",",Rakudo::QuantHash.RAW-VALUES-MAP(self, *.perl))
),
')'
nqp::concat(self.^name,'.new('),
nqp::concat(
nqp::join(",",Rakudo::QuantHash.RAW-VALUES-MAP(self, *.perl)),
')'
)
)
)
}

Expand Down

0 comments on commit af3624d

Please sign in to comment.