Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-lub also hard union types in simplify (#20027)
Simplify had some elaborate condition that prevented hard union types to be recomputed with a lub. I am not sure why that was. In the concrete scenario of i10693.scala, we had an explicitly written union result type `B | A` where `A` and `B` are type parameters. So that is a hard union type. Then `A` was instantiated to `Int | String` and `B` was instantiated to `String | Int`. Re-forming the lub of that union would have eliminated one pair, but since the union type was hard that was not done. On the other hand I see no reason why hard unions should not be re-lubbed. Hard unions are about preventing the widening of or types with a join. I don't see a connection with avoiding re-lubbing. Fixes #10693
- Loading branch information