void expectSuperType ( Node n , ObjectType superObject , ObjectType subObject ) { FunctionType subCtor = subObject . getConstructor ( ) ; ObjectType implicitProto = subObject . getImplicitPrototype ( ) ; ObjectType declaredSuper = implicitProto == null ? null : implicitProto . getImplicitPrototype ( ) ; if ( declaredSuper != null && declaredSuper . isTemplatizedType ( ) ) { declaredSuper = declaredSuper . toMaybeTemplatizedType ( ) . getReferencedType ( ) ; } if ( declaredSuper != null && ! ( superObject instanceof UnknownType ) && ! declaredSuper . isEquivalentTo ( superObject ) ) { if ( declaredSuper . isEquivalentTo ( getNativeType ( OBJECT_TYPE ) ) ) { registerMismatch ( superObject , declaredSuper , report ( JSError . make ( n , MISSING_EXTENDS_TAG_WARNING , subObject . toString ( ) ) ) ) ; } else { mismatch ( n , "mismatch in declaration of superclass type" , superObject , declaredSuper ) ; } // Correct the super type. if ( ! subCtor . hasCachedValues ( ) ) { subCtor . setPrototypeBasedOn ( superObject ) ; } } }
Expect that the first type is the direct superclass of the second type .