mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
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 |
||
|---|---|---|
| .. | ||
| analysis | ||
| dependencies | ||
| entry_point_finder | ||
| execution | ||
| host | ||
| locking | ||
| migrations | ||
| packages | ||
| rendering | ||
| writing | ||
| command_line_options.ts | ||
| constants.ts | ||
| main.ts | ||
| ngcc_options.ts | ||
| path_mappings.ts | ||
| utils.ts | ||