Skip to content
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

Re-lub also hard union types in simplify #20027

Merged
merged 3 commits into from Apr 4, 2024
Merged

Commits on Mar 27, 2024

  1. Re-lub also hard union types in simplify

    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 union result type `B | A` where `A` and `B` are
    type parameters. So that is a hard union type. Then `A` was instantiated by `Int | String`
    and `B` was instantiated by `String | Int`. Re-forming the lub of that union would
    have eliminated one pair, but since the union type was hard tyat 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 scala#10693
    odersky committed Mar 27, 2024
    Copy the full SHA
    01e715d View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    5bf3227 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    5a15892 View commit details
    Browse the repository at this point in the history