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 match type reduction with avoided types #18043

Merged
merged 7 commits into from
Jul 3, 2023
Merged

Commits on Jun 23, 2023

  1. Cleanup TreeChecker adapt assertion message

    The "infoStr" I felt caused more noise and confusion, so I remove it.
    I also pushed the type mismatch message done 1 line, so it displays
    better multi-line (the "Found" and "Required" are alined).
    dwijnand committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    823f17b View commit details
    Browse the repository at this point in the history
  2. Normalize in Type#atoms

    TypeComparer's compareAtoms assumes it has an answer to subtyping if one
    of the types has atoms and the other doesn't.  But an unreduced match
    alias won't have atoms, so we shouldn't bail early.
    
    Co-Authored-By: Matt Bovel <matthieu@bovel.net>
    dwijnand and mbovel committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    d3a877f View commit details
    Browse the repository at this point in the history
  3. Widen scrutinees in TypeComparer's compareMatch

    If the skolem-widened scrutinees are the same and the cases correspond,
    then the match types are the same.
    
    Also, with inlining the type embeded in inlining's Typed expression will
    be without going through type-avoidance, so they won't be skolems.  So
    we look to widen inline proxy term refs, in addition to skolems.
    
    Co-Authored-By: Matt Bovel <matthieu@bovel.net>
    dwijnand and mbovel committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    97dcf78 View commit details
    Browse the repository at this point in the history
  4. Test term ref scrutinees aren't generally widened

    Co-Authored-By: Matt Bovel <matthieu@bovel.net>
    dwijnand and mbovel committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    fcc753b View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2023

  1. In compareMatch, check scrutinees are subtypes

    From the Match Type paper, typing rule S-Match5 requires that the LHS
    scrutinee "Ss" is a subtype of the RHS scrutinee "Ts": Ss <: Ts.  It's
    not required that they are the same type.  This covers widening a skolem
    or inline proxy tp1 scrutinee, without erroneously widening the RHS tp2
    scrutinee.
    dwijnand committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    7825d77 View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2023

  1. Configuration menu
    Copy the full SHA
    27ae379 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    91c9afc View commit details
    Browse the repository at this point in the history