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

Type Constructors for Generic Directives #41043

Closed
wants to merge 2 commits into from

Commits on Mar 17, 2021

  1. refactor(compiler-cli): don't use FakeEnvironment for tcb tests

    For the tests in //packages/compiler-cli/src/ngtsc/typecheck, this
    commits uses a `TypeCheckFile` for the environment, rather than a
    `FakeEnvironment`. Using a real environment gives us more flexibility
    with testing.
    zarend committed Mar 17, 2021
    Configuration menu
    Copy the full SHA
    b859c50 View commit details
    Browse the repository at this point in the history
  2. fix(compiler-cli): add useInlining option to type check config

    This commit fixes the behavior when creating a type constructor for a directive when the following
    conditions are met.
    1. The directive has bound generic parameters.
    2. Inlining is not available. (This happens for language service compiles).
    
    Previously, we would throw an error saying 'Inlining is not supported in this environment.' The
    compiler would stop type checking, and the developer could lose out on getting errors after the
    compiler gives up.
    
    This commit adds a useInlineTypeConstructors to the type check config. When set to false, we use
    `any` type for bound generic parameters to avoid crashing. When set to true, we inline the type
    constructor when inlining is required.
    
    Addresses angular#40963
    zarend committed Mar 17, 2021
    Configuration menu
    Copy the full SHA
    d630414 View commit details
    Browse the repository at this point in the history