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

Refactor diverging and numeric fallback. #46714

Merged
merged 9 commits into from
Feb 16, 2018

Commits on Jan 27, 2018

  1. refactor structurally_resolve_type

    the `or_else` part was dead code.
    leoyvens committed Jan 27, 2018
    Configuration menu
    Copy the full SHA
    c01bfbd View commit details
    Browse the repository at this point in the history
  2. Lazy numeric fallback.

    This refactoring tries to make numeric fallback easier to reason about.
    Instead of applying all fallbacks at an arbitrary point in the middle
    of inference, we apply the fallback only when necessary and only for
    the variable that requires it, which for numeric fallback turns out to
    be just casts.
    
    The only visible consequence seems to be some error messages where
    instead of getting `i32` we get `{integer}` because we are less eager
    about fallback.
    
    The bigger goal is to make it easier to integrate user fallbacks into
    inference, if we ever figure that out.
    leoyvens committed Jan 27, 2018
    Configuration menu
    Copy the full SHA
    3d83fc9 View commit details
    Browse the repository at this point in the history
  3. Refactor away fn default_type_parameters

    It had only one caller.
    leoyvens committed Jan 27, 2018
    Configuration menu
    Copy the full SHA
    f3cd4a7 View commit details
    Browse the repository at this point in the history
  4. No fallback in structurally_resolve_types. Further refactoring.

    Put all fallback in `apply_fallback_if_possible`.
    leoyvens committed Jan 27, 2018
    Configuration menu
    Copy the full SHA
    02084f3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4c0ff95 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    cd4de4c View commit details
    Browse the repository at this point in the history
  7. Only closure analysis should run after fallback.

    Move `check_casts` and `resolve_generator_interiors` to before fallback.
    
    Rename `apply_fallback_if_possible` to `fallback_if_possible`.
    
    Refactor `select_all_obligations_or_error`.
    leoyvens committed Jan 27, 2018
    Configuration menu
    Copy the full SHA
    f8c1404 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    b813718 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2018

  1. Revert checking casts before fallback.

    This turns out to not be backwards compatible.
    leoyvens committed Feb 8, 2018
    Configuration menu
    Copy the full SHA
    d49d428 View commit details
    Browse the repository at this point in the history