Commit fd2a03e
authored
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 #106931 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments