Skip to content

Commit

Permalink
Str.comb takes its cue from string rather than numeric value
Browse files Browse the repository at this point in the history
Fixes GH#2010.

In GH#1552 it was decided that the boolean value of allomorphs is decided by
the numerical value, not by the string value.  So from that, it *could* follow
that the behaviour is correct.  However, since `.comb` clearly works on the
the string part of the allomorph, it seemed like the right thing to do to use
the string semantics of Bool instead in this case.
  • Loading branch information
lizmat committed Jul 2, 2018
1 parent a9e844a commit f8d6a3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/Str.pm6
Expand Up @@ -352,7 +352,7 @@ my class Str does Stringy { # declared in BOOTSTRAP
}
method new(\string) {
nqp::if(
string,
string.chars, # GH#1020
nqp::create(self)!SET-SELF(string),
Rakudo::Iterator.Empty
)
Expand Down

0 comments on commit f8d6a3f

Please sign in to comment.