Skip to content

Commit

Permalink
Fix build break (#147)
Browse files Browse the repository at this point in the history
Propagate `externalTypes` since `assembly.externals` has been removed.
  • Loading branch information
Elad Ben-Israel authored Aug 6, 2018
1 parent 868cd56 commit d441c11
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit d441c11

Please sign in to comment.