diff --git a/packages/jsii-diff/lib/classes-ifaces.ts b/packages/jsii-diff/lib/classes-ifaces.ts index f2f0ace0fc..5f7ef5e694 100644 --- a/packages/jsii-diff/lib/classes-ifaces.ts +++ b/packages/jsii-diff/lib/classes-ifaces.ts @@ -27,12 +27,16 @@ export function compareReferenceType(original: context.mismatches.report(original, 'has gone from @subclassable to non-@subclassable'); } - for (const [origMethod, updatedMethod] of memberPairs(original, original.allMethods, updated, context)) { - compareMethod(original, origMethod, updatedMethod, context); + for (const [origMethod, updatedElement] of memberPairs(original, original.allMethods, updated, context)) { + if (reflect.isMethod(origMethod) && reflect.isMethod(updatedElement)) { + compareMethod(original, origMethod, updatedElement, context); + } } - for (const [origProp, updatedProp] of memberPairs(original, original.allProperties, updated, context)) { - compareProperty(original, origProp, updatedProp, context); + for (const [origProp, updatedElement] of memberPairs(original, original.allProperties, updated, context)) { + if (reflect.isProperty(origProp) && reflect.isProperty(updatedElement)) { + compareProperty(original, origProp, updatedElement, context); + } } // You cannot have added abstract members to the class/interface, as they are @@ -174,7 +178,7 @@ function compareProperty(origClass: reflect.Type, original: reflect.Property, up } // tslint:disable-next-line:max-line-length -function* memberPairs(origClass: U, xs: T[], updatedClass: U, context: ComparisonContext): IterableIterator<[T, T]> { +function* memberPairs(origClass: U, xs: T[], updatedClass: U, context: ComparisonContext): IterableIterator<[T, reflect.TypeMember]> { for (const origMember of xs.filter(shouldInspect(context))) { LOG.trace(`${origClass.fqn}#${origMember.name}`); @@ -192,7 +196,7 @@ function* memberPairs