fix(compiler): allow to use flat modules and summaries

The combination of flat modules, flat module redirects and summaries
lead to errors before.
This commit is contained in:
Tobias Bosch
2017-09-28 09:39:16 -07:00
committed by Victor Berchet
parent 14e8e88022
commit ec2be5dccb
8 changed files with 147 additions and 96 deletions

View File

@ -21,6 +21,7 @@ export abstract class SummaryResolver<T> {
abstract resolveSummary(reference: T): Summary<T>|null;
abstract getSymbolsOf(filePath: string): T[]|null;
abstract getImportAs(reference: T): T;
abstract getKnownModuleName(fileName: string): string|null;
abstract addSummary(summary: Summary<T>): void;
}
@ -35,5 +36,6 @@ export class JitSummaryResolver implements SummaryResolver<Type> {
}
getSymbolsOf(): Type[] { return []; }
getImportAs(reference: Type): Type { return reference; }
getKnownModuleName(fileName: string) { return null; }
addSummary(summary: Summary<Type>) { this._summaries.set(summary.symbol, summary); }
}