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

Add captureset levels (draft) #18348

Closed
wants to merge 15 commits into from

Commits on Aug 7, 2023

  1. Drop another impure function adaptation

    This was overlooked before.
    odersky committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    7176548 View commit details
    Browse the repository at this point in the history
  2. Test case

    This demonstrates currently unsoundness when it comes to assignments via setters
    odersky committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    0bf6a25 View commit details
    Browse the repository at this point in the history
  3. Simplify healTypeParam

    odersky committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    8205ae9 View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2023

  1. Fix installAfter corner case

    There was a corner case in installAfter where
    
     - A denotation valid in a single phase got replaced by another one
     - Immediately after, the symbol's denotation would be forced in a previous phase
    
    This somehow landed on a wrong denotation. The problem got apparent when more symbols
    underwent a Recheck.updateInfoBetween. The flags field installed by a previous update
    somehow was not recognized anymore. Specifically, the following was observed in order:
    
     1. For a parameter getter (xs in LazyList, file pos-custeom-args/captures/lazylists1.scala)
       the Private flag was suppressed via transformInfo at phase cc.
     2. The denotation of the getter v which was valid in the single phase cc+1 was updated at
        at cc by updateInfoInBetween in Recheck so that the Private flag was re-asserted in cc+1.
     3. Immediately afterwards, the getter's flags was demanded at phase cc.
     4. The Private flag was present, even though it should not be.
    
    The problem was fixed by demanding the denotation of the getter as part of isntallAfter.
    odersky committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    6339276 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2023

  1. Change closure handling

    Constrain closure parameters and result from expected type before rechecking the closure's
    body. This gives more precise types and avoids the spurious duplication of some
    variables.
    
    It also avoids the unmotivated special case that we needed before to make tests pass.
    odersky committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    c4aefa1 View commit details
    Browse the repository at this point in the history
  2. Fix SimpleIdentitySet#map

    Previously, the result of a map could contain duplicates.
    
    I verified that with the current code base this could cause problems only for
    capture checking.
    odersky committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    77aa78f View commit details
    Browse the repository at this point in the history
  3. Use a BiTypeMap for substitutions when possible

    This reduces the chance of information loss in capture set
    propagation for applications.
    odersky committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    9fa253d View commit details
    Browse the repository at this point in the history
  4. Cleanup SubstParamsMap

    odersky committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    2b3007a View commit details
    Browse the repository at this point in the history
  5. Fix typo in exception message

    odersky committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    4290e61 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2023

  1. Fix BiTypeMap#inverse

    odersky committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    1051563 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2023

  1. Handle levels in constraint solving

     - Define a notion of ccNestingLevel, which corresponds to the nesting level
       of so called "level owners" relative to each other.
     - The outermost level owner is _root_.
     - Other level owners are classes that are not staticOwners
       and methods that are not constructors.
     - The ccNestingLevel of any symbol is the ccNestingLevel of its closest enclosing
       level owner, or -1 for NoSymbol.
     - Capture set variables are created with a level owner.
     - Capture set variables cannot include elements with higher ccNestingLevels
       than the variable's owner.
     - If level-incorrect elements are attempted to be added to a capture set variable,
       they are instead widened to the underlying capture set.
    odersky committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    63b6aae View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2023

  1. Configuration menu
    Copy the full SHA
    874837a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f6da2ac View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cd67244 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    91135fb View commit details
    Browse the repository at this point in the history