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

Fix #6385: Don't instantiate hk type constructors too early #6467

Merged
merged 6 commits into from
May 17, 2019

Commits on May 17, 2019

  1. Replace singleton bounds before doing implicit search

    Before searching for implicit arguments, if a the constraint
    contains a type parameter
    ```
       P >: A <: B
    ```
    where `P` occurs in the searched-for type and `A =:= B`, change the constraint
    to
    ```
       P := B
    ```
    instead. This improves the implicit search by making the searched-for type
    have fewer uninstantiated type variables.
    odersky authored and smarter committed May 17, 2019
    Configuration menu
    Copy the full SHA
    c8eb14f View commit details
    Browse the repository at this point in the history
  2. Don't instantiate hk type constructors too early

    The issue scala#6385 contains more explanations.
    odersky authored and smarter committed May 17, 2019
    Configuration menu
    Copy the full SHA
    18ce5d2 View commit details
    Browse the repository at this point in the history
  3. Optimize replaceSingletons

    Avoid formation of full bounds.
    odersky authored and smarter committed May 17, 2019
    Configuration menu
    Copy the full SHA
    baaa562 View commit details
    Browse the repository at this point in the history
  4. Another optimization

    In fact, the isLess relation is irrelevant here. If
    
      p >: L <: H   and  L =:= H
    
    and the constraint is satisfiable, then it's safe to replace p by L or H
    anyway, no matter what other parameters are known to be smaller or larger
    than p.
    odersky authored and smarter committed May 17, 2019
    Configuration menu
    Copy the full SHA
    4422483 View commit details
    Browse the repository at this point in the history
  5. Drop no-longer applicable comments

    odersky authored and smarter committed May 17, 2019
    Configuration menu
    Copy the full SHA
    8332964 View commit details
    Browse the repository at this point in the history
  6. Fix scala#4147: Add test case

    18ce5d2 fixed it.
    smarter committed May 17, 2019
    Configuration menu
    Copy the full SHA
    4c7ca9a View commit details
    Browse the repository at this point in the history