Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build break #147

Merged
merged 1 commit into from
Aug 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/jsii/lib/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export async function compileSources(entrypoint: string,
await processModule(rootModule, []);
addTypeInfo(assm, types);
verifyUnexportedTypes(assm, typeRefs, externalTypes);
validateOverriddenSignatures(assm);
validateOverriddenSignatures(assm, externalTypes);
normalizeInitializers(assm, externalTypes);
}

Expand Down Expand Up @@ -1287,7 +1287,7 @@ function addTypeInfo(mod: spec.Assembly, types: spec.Type[]) {
*
* Must be called after verifyUnexportedTypes() which hoists external types.
*/
function validateOverriddenSignatures(mod: spec.Assembly) {
function validateOverriddenSignatures(mod: spec.Assembly, externalTypes: Map<string, spec.Type>) {
if (!mod.types) { return; }

for (const typeName of Object.keys(mod.types)) {
Expand Down Expand Up @@ -1386,7 +1386,7 @@ function validateOverriddenSignatures(mod: spec.Assembly) {
*/
function getType(fqn: string): spec.Type {
if (mod.types && mod.types[fqn]) { return mod.types[fqn]; }
if (mod.externals && mod.externals[fqn]) { return mod.externals[fqn]; }
if (externalTypes && externalTypes.has(fqn)) { return externalTypes.get(fqn)!; }
throw new Error(`Unknown type: ${fqn}`);
}
}
Expand Down