Match element fixes - #13002
Match element fixes#13002
Conversation
0e58692 to
dda2d68
Compare
dda2d68 to
3bf41ee
Compare
|
Thanks, I think this is ready for a final ok from @ogoffart . |
ogoffart
left a comment
There was a problem hiding this comment.
I'm not sure about this float restriction.
We allow == on float.
matching a float on a 0 is the same as matching it on a 0.0
Also there is no restruction for, say, length which has the same problem.
|
The float restriction was based on this. If you think we should allow it, I think it would have to be allowed based on the existing fuzzy comparison in Slint. We have to consider how we want to handle cases that would fuzzy-compare as equal, resulting in two elements being permitted through the match element instead of one. That would be no different from two conditional elements, but might not be the expected behaviour of a match element. We could potentially allow it with a warning? |
48177c2 to
c56a1aa
Compare
c56a1aa to
d2ab6f8
Compare
|
I pulled the float error code into its own PR (#13399) so we can decide on that later. This PR now just has the two commits which hopefully can be merged. |
d2ab6f8 to
e2e8430
Compare
Hash values when checking for duplicates/exhaustiveness instead of running a O(N^2) search over them
Match statements are now covered in the NodeJS test driver as well
e2e8430 to
3469d6f
Compare
This pr resolves the rest of the issues in #12680
1.0or3.0Hashbeing implemented forEnumerationValueand derived forUnitjstest blocks for all match statement testsOptionI believe was already addressed