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

Maintain more structural information in type-checking errors #10170

Merged
merged 11 commits into from
May 7, 2021

Commits on May 7, 2021

  1. Configuration menu
    Copy the full SHA
    b5a5f01 View commit details
    Browse the repository at this point in the history
  2. Add tests before improving the internal type error representation

    Some of these tests point at behavior we're about to change; some of
    them point to behavior we're confirming that we don't change.
    
    * `constraints.ml`, `unbound_type_variables.ml`: Existing code whose
      behavior we won't change; however, we do fix the indentation in some
      of the type errors.
    * `poly.ml`: Add one test whose behavior will change (more detail) and
      reword one test to use clearer variable names.
    * `inclusion_errors.ml`: New tests that will confirm our internal
      changes did not (yet) have externally-visible changes to the type
      errors.
    
    This commit includes existing work by Mekhrubon Tuarev, who did all
    the early development.  I (Antal Spector-Zabusky) came and built the
    layer of types on top.
    Mekhrubon Turaev authored and antalsz committed May 7, 2021
    Configuration menu
    Copy the full SHA
    14ff896 View commit details
    Browse the repository at this point in the history
  3. Maintain more structural information in type-checking errors

    This commit refactors the types that make up type-checking errors to
    maintain more structural information.  Most significantly, we split
    out the errors we get from unification, moregen, and type equality in
    `Ctype` into three distinct exceptions, and retain the sorts of
    information we keep during unification in the other two cases as well
    (no more `Unify []`).  We also maintain more information in
    `Includecore` about mismatches of primitives, manifests, and private
    objects and variants
    
    This commit doesn't make a lot of changes to the user-visible error
    messages yet, only what's necessary to support the type changes, but
    it enables a forthcoming patch where we use this improvement to
    produce more informative error messages.
    
    This commit includes existing work by Mekhrubon Tuarev, who did all
    the early development.  I (Antal Spector-Zabusky) came and built the
    layer of types on top.
    antalsz committed May 7, 2021
    Configuration menu
    Copy the full SHA
    e87be39 View commit details
    Browse the repository at this point in the history
  4. Address all the excellent reviewer suggestions

    One test changes here, reverting to its pre-patch format, as a result
    of some unification of different trace printing behavior; the prior
    error message was considered acceptable as well, and both contain the
    same amount of information, so this doesn't seem to be an issue.
    antalsz committed May 7, 2021
    Configuration menu
    Copy the full SHA
    bd030c0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1656496 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ee9dd52 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1d2ad77 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c8d8ef7 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7157ce2 View commit details
    Browse the repository at this point in the history
  10. Add missing copyright headers to errortrace.ml{,i}

    The code was pulled out of `ctype.ml{,i}`; per Florian, he wrote the
    code for `Unification_trace` in 2018.
    antalsz committed May 7, 2021
    Configuration menu
    Copy the full SHA
    e16653e View commit details
    Browse the repository at this point in the history
  11. Fix formatting issues

    * Fit to 80-column line width
    * Remove stray non-ASCII character
    * Delete stray empty line at end of file
    antalsz committed May 7, 2021
    Configuration menu
    Copy the full SHA
    00dfb07 View commit details
    Browse the repository at this point in the history