Simplify unions based on subclass relationships
Open
google
needs-discussion
typechecking
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 519
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
`int | bool` should simplify to `int` since `bool` is a subclass of `int`
We don't simplify unions based on subclass relationships right now because the representation of types makes it fairly expensive. The downside of not doing this is that we make unions that are larger than necessary, which degrades performance.
Will need to profile this if we do it
### Sandbox Link
_No response_
### (Only applicable for extension issues) IDE Information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.