angular/packages/compiler-cli/ngcc/src
JoostK 9470f56ad3 fix(compiler-cli): handle directives that refer to a namespaced class in a type parameter bound (#43511)
The template type-checker has to emit type constructors for the
directives that are used in a template, where a type constructor's
declaration has to mirror the type parameter constraints as they were
originally declared. Therefore, the compiler analyzes whether a type
parameter constraint can be recreated, e.g. by generating imports for
any type references. Some type references cannot be recreated, in which
case the compiler has to fall back to a strategy where the type
constructor is created inline in the original source file (which comes
with a performance penalty).

There used to be an issue for type references to namespaced declarations.
The compiler is unable to emit such references such that an inline
type constructor should be used as fallback, but this did not happen.
This caused the attempt to emit the type reference to fail, as the
namespaced declaration cannot be located by the reference emitters.

This commit fixes the issue by using a stricter check to determine if a
type parameter requires an inline type constructor. The TypeScript
reflection host's `isStaticallyExported` logic was expanded to work for
any declaration instead of just classes, as e.g. type declarations can
also be referenced in a type parameter constraint.

Closes #43383

PR Close #43511
2021-09-20 19:56:31 +00:00
..
analysis refactor(compiler-cli): replace the IncrementalDriver with a new design (#41475) 2021-04-13 13:05:35 -07:00
dependencies refactor: add override keyword to members implementing abstract declarations (#42512) 2021-07-12 13:11:17 -07:00
entry_point_finder refactor: add override keyword to members implementing abstract declarations (#42512) 2021-07-12 13:11:17 -07:00
execution refactor: add override keyword to members implementing abstract declarations (#42512) 2021-07-12 13:11:17 -07:00
host fix(compiler-cli): handle directives that refer to a namespaced class in a type parameter bound (#43511) 2021-09-20 19:56:31 +00:00
locking refactor(compiler-cli): update to use new file-system interfaces (#40281) 2021-01-08 09:34:44 -08:00
migrations refactor(compiler-cli): implement DeclarationNode node type (#38959) 2020-10-12 08:32:46 -07:00
packages refactor(compiler-cli): ensure compatibility with noImplicitOverride (#42512) 2021-07-12 13:11:14 -07:00
rendering refactor(compiler-cli): ensure compatibility with noImplicitOverride (#42512) 2021-07-12 13:11:14 -07:00
writing refactor(compiler-cli): ensure compatibility with noImplicitOverride (#42512) 2021-07-12 13:11:14 -07:00
command_line_options.ts refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
constants.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
main.ts refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
ngcc_options.ts refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
path_mappings.ts refactor(compiler-cli): update to use new file-system interfaces (#40281) 2021-01-08 09:34:44 -08:00
utils.ts feat(ngcc): support __read helper as used by TypeScript 4.2 (#41201) 2021-03-16 11:06:31 -07:00