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

ObjectTpeJava is truly unique; bounds; isAnyTpe #8049

Merged
merged 2 commits into from
May 14, 2019

Commits on May 13, 2019

  1. ObjectTpeJava part 2

    Make sure the TypeRef is truly unique, even when embedded
    in other types, such as a TypeBounds. Since we're dealing
    with structural equality, `TypeBounds(lo, hi) == TypeBounds(lo', hi')`
    if `lo == lo'` and `hi == hi'`, if `hi = ObjectTpe` and `hi' = ObjectTpe'`,
    `unique`'ing (hashconsing) such a `TypeBounds` would indirectly
    replace `ObjectTpe` with `ObjectTpeJava` or vice versa.
    
    We can't use `eq` when trying to identify `ObjectTpeJava` in `unique`
    due to cycles.
    
    Further fixes by Lukas:
      - Don't show ObjectTpeJava upper bound in TypeBounds.toString
      - Upper bounds of wildcards should be ObjectTpeJava
      - Fix wildcardExtrapolation for BoundedWildcardType with hi ObjectTpeJava
    
    Reduce `_ >: lo <: ObjectTpeJava` to `lo`. This eliminates the
    `BoundedWildcardType` in the expected type when type-checking the
    lambda
    
        (c: java.util.Collection[String]).removeIf(x => true)
    
    where
    
        boolean removeIf(Predicate<? super E> filter)
    adriaanm committed May 13, 2019
    Configuration menu
    Copy the full SHA
    477edc1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7bf179f View commit details
    Browse the repository at this point in the history