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

Better comparisons for type projections #17092

Merged
merged 3 commits into from
Mar 25, 2023
Merged

Commits on Mar 12, 2023

  1. Better comparisons for type projections

    We already implemented in essence the rule suggested in lampepfl/dotty-feature-requests#14:
    
    ```
    Γ ⊨ p : T
    ------------------------ (Sel-<:-Proj)
    Γ ⊨ p.A <: T#A
    ```
    
    This rule is implemented in `isSubPrefix`. But we did not get to check that since we concluded prematurely that
    an alias type would never match. The alias type in question in i17064.scala was
    
    ```scala
    Outer#Inner
    ```
    Since `Outer` is not a path, the asSeenFrom to recover the info of `Outer#Inner this got approximated with
    a `Nothing` argument and therefore the alias failed. It is important in this case that we could still succeed
    with a `isSubPrefix` test, which comes later. So we should not return `false` when the prefix is not a singleton.
    
    Fixes scala#17064
    odersky committed Mar 12, 2023
    Configuration menu
    Copy the full SHA
    2ac2315 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2023

  1. Configuration menu
    Copy the full SHA
    c8efe69 View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2023

  1. Simplify hasPrecisePrefix check

    `NoPrefix.isStable` already returns true.
    smarter committed Mar 25, 2023
    Configuration menu
    Copy the full SHA
    d17da7a View commit details
    Browse the repository at this point in the history