Skip to content

port #41043 to patch branch.#41268

Closed
zarend wants to merge 2 commits intoangular:11.2.xfrom
zarend:patch/inline-type-constructors
Closed

port #41043 to patch branch.#41268
zarend wants to merge 2 commits intoangular:11.2.xfrom
zarend:patch/inline-type-constructors

Conversation

@zarend
Copy link
Copy Markdown
Contributor

@zarend zarend commented Mar 18, 2021

port #41043 to patch branch.

#41043 was merged into master but not the patch branch because of merge conflict with 11.2.x branch. This ports #41043 to 11.2.x branch.

Note to caretaker: this should not need review from the usual groups because the original PR for this (#41043) was already approved. Presubmit is not necessary because this is not going into master.

zarend added 2 commits March 18, 2021 11:10
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.
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
@google-cla google-cla bot added the cla: yes label Mar 18, 2021
@pullapprove pullapprove bot requested review from JoostK and kyliau March 18, 2021 18:16
@zarend zarend changed the title Patch/inline type constructors port #41043 to path branch. Mar 18, 2021
@zarend zarend removed request for JoostK and kyliau March 18, 2021 18:19
@pullapprove pullapprove bot requested review from JoostK and kyliau March 18, 2021 18:19
@zarend zarend requested review from mhevery and removed request for JoostK and kyliau March 18, 2021 18:20
@pullapprove pullapprove bot requested review from JoostK and kyliau March 18, 2021 18:20
@zarend zarend added the area: compiler Issues related to `ngc`, Angular's template compiler label Mar 18, 2021
@ngbot ngbot bot added this to the Backlog milestone Mar 18, 2021
@zarend zarend added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Mar 18, 2021
@ngbot ngbot bot added the action: merge The PR is ready for merge by the caretaker label Mar 18, 2021
@zarend zarend changed the title port #41043 to path branch. port #41043 to patch branch. Mar 18, 2021
@zarend zarend removed request for JoostK and kyliau March 18, 2021 18:23
@pullapprove pullapprove bot requested review from JoostK and kyliau March 18, 2021 18:23
@mhevery mhevery added the target: patch This PR is targeted for the next patch release label Mar 19, 2021
@mhevery
Copy link
Copy Markdown
Contributor

mhevery commented Mar 19, 2021

Closed by commit 57644e9

@mhevery mhevery closed this Mar 19, 2021
mhevery pushed a commit that referenced this pull request Mar 19, 2021
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.

PR Close #41268
mhevery pushed a commit that referenced this pull request Mar 19, 2021
)

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 #40963

PR Close #41268
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler cla: yes merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants