-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different behavior of $foo ~~ 0 in 5.10.0. #59
Comments
Arguably it's post-5.10.1 that's broken... for MS purposes. :-) Actually, though, it's the test that's broken. The line:
should be:
|
BTW, the new new smartmatch semantics currently proposed |
I think the behavior of
If that's the case, if when is going to try and differentiate undef from 0
I would suggest not using smart match. It's unstable across versions and Alternatively we special case empty string. Alternatively we define "when" as "whatever smart match does". If we're going to use smart match, I like the last one. We don't have to work |
I think we ought to go with "whatever smartmatch does". If they need to be more specific, there's always:
or:
They're going to have to get used to being more specific anyway, Damian |
Okay, this was causing 12 of the 17 failures on CPAN Testers. Fixed as per @thoughtstream suggested. I'm closing this one down. |
t/zero_defaults.t is failing on 5.10.0. The problem is the copy_cat() method. It does not consider an empty string to be a default. The issue is with how $foo ~~ 0 behaves.
copy_cat
expands out into this:On 5.10.0,
"" ~~ 0
is false. From 5.10.1 on it's true.Smart match before 5.10.1 is unstable. Simplest thing to do might be to boost the minimum requirement for that feature to 5.10.1.
The text was updated successfully, but these errors were encountered: