-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Unexpected type inference changes related to enum value attributes #12051
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
Labels
Comments
JukkaL
added a commit
that referenced
this issue
Jan 24, 2022
A few bugs in type operations were exposed by #11962. This fixes them. Fix #12051, but other use cases are affected as well. First, when we erase last known values in an union with multiple Instance types, make sure that the resulting union doesn't have duplicate erased types. The duplicate items weren't incorrect as such, but they could cause overly complex error messages and potentially slow type checking performance. Second, make the join of a union type and Any commutative. Previously the result dependend on the order of the operands, which was clearly incorrect.
JukkaL
added a commit
that referenced
this issue
Jan 25, 2022
A few bugs in type operations were exposed by #11962. This fixes them. Fix #12051, but other use cases are affected as well. First, when we erase last known values in an union with multiple Instance types, make sure that the resulting union doesn't have duplicate erased types. The duplicate items weren't incorrect as such, but they could cause overly complex error messages and potentially slow type checking performance. Second, make the join of a union type and Any commutative. Previously the result dependend on the order of the operands, which was clearly incorrect.
JukkaL
added a commit
that referenced
this issue
Jan 25, 2022
When we erase last known values in an union with multiple Instance types, make sure that the resulting union doesn't have duplicate erased types. The duplicate items weren't incorrect as such, but they could cause overly complex error messages and potentially slow type checking performance. This is one of the fixes extracted from #12054. Since some of the changes may cause regressions, it's better to split the PR. Work on #12051. Co-authored-by: Nikita Sobolev <[email protected]>
JukkaL
added a commit
that referenced
this issue
Jan 25, 2022
Make the join of a union type and Any commutative. Previously the result dependend on the order of the operands, which was clearly incorrect. Fix #12051, but other use cases are affected as well.
JukkaL
added a commit
that referenced
this issue
Jan 25, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this example, the behavior changed in #11962:
These seem like regressions. The duplicate int types in unions seem like an unrelated issue that #11962 exposed. In some cases it can result in unions with dozens of items, which look pretty confusing. I'm not sure yet whether the second change is an issue with #11962 or something else.
The text was updated successfully, but these errors were encountered: