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 Signature handling for unions and generics #391

Merged
merged 2 commits into from
Apr 1, 2022

Commits on Apr 1, 2022

  1. Add failing test for distributive signature types

    (cherry picked from commit 9c9f023)
    chriskrycho committed Apr 1, 2022
    Configuration menu
    Copy the full SHA
    cccccd2 View commit details
    Browse the repository at this point in the history
  2. Fix type distributivity in Glimmer Component Signature

    When using a `keyof` type to check whether the type parameter for
    Glimmer Component is a `Signature` or the classic `Args`-only type, if
    we do not force TS to distribute over union types, it resolves the
    `keyof` check for union types with no shared members as `never`, and
    `never extends <anything>` is always true. This in turn meant that for
    all such unions, as well as for cases where users were providing
    generic types which could then be further extended in their own
    subclasses.
    
    Accordingly, introduce the standard technique TypeScript provides for
    opting into distributivity: conditional types are documented to support
    exactly this.
    
    (cherry picked from commit ad429d5)
    chriskrycho committed Apr 1, 2022
    Configuration menu
    Copy the full SHA
    006323e View commit details
    Browse the repository at this point in the history