fix(compiler): fix inheritance for AOT with summaries (#15583)
Allows to inherit ctor args, lifecycle hooks and statics from a class in another compilation unit. Will error if trying to inherit from a class in another compilation unit that has an `@Component` / `@Directive` / `@Pipe` / `@NgModule`.
This commit is contained in:

committed by
Alex Rickabaugh

parent
28bf222a6a
commit
8ef621ad2a
@ -307,6 +307,17 @@ export class StaticSymbolResolver {
|
||||
private createResolvedSymbol(
|
||||
sourceSymbol: StaticSymbol, topLevelPath: string, topLevelSymbolNames: Set<string>,
|
||||
metadata: any): ResolvedStaticSymbol {
|
||||
// For classes that don't have Angular summaries / metadata,
|
||||
// we only keep their arity, but nothing else
|
||||
// (e.g. their constructor parameters).
|
||||
// We do this to prevent introducing deep imports
|
||||
// as we didn't generate .ngfactory.ts files with proper reexports.
|
||||
if (this.summaryResolver.isLibraryFile(sourceSymbol.filePath) && metadata &&
|
||||
metadata['__symbolic'] === 'class') {
|
||||
const transformedMeta = {__symbolic: 'class', arity: metadata.arity};
|
||||
return new ResolvedStaticSymbol(sourceSymbol, transformedMeta);
|
||||
}
|
||||
|
||||
const self = this;
|
||||
|
||||
class ReferenceTransformer extends ValueTransformer {
|
||||
|
Reference in New Issue
Block a user