-
Notifications
You must be signed in to change notification settings - Fork 463
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
CaseOfCase kind mismatch error fix #5923
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not nearly enough:
- most importantly, this function is in some general module, how can you be sure you're not breaking something else by reversing the order of the result? There's no comment on what that function is supposed to return, no examples etc, maybe that's how it's supposed to work for some other use case that isn't case-of-case. I don't see any way around going through all transitive dependencies and ensuring you aren't breaking things elsewhere
- please document the offending function, so that it's clear what it returns to reduce the possibility of us screwing things up the same way again
- please add the test that caught the bug as a unit/golden test to make sure we never regress back
Besides The tests for
I've added comment and test cases to explain the semantics as I understood them. I'd be grateful to @michaelpj for checking those test cases making sure that I inferred the intended behavior correctly.
Done.
It was the property test that caught the bug, and its already there. I think that unit tests for the |
So the analysis is that this would only happen when we had case-of-case on a type that had two type parameters, is that right? That does indeed seem like something we might not have tripped up on until now. Hooray for the generators! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed on the call I'd prefer to record the offender to increase coverage, but I'm not gonna be an ass about it, so here's your approval.
I have recorded the offender as a golden test ;-) |
Closes #5922 by fixing order of type arguments as they are extracted.