private void checkInterfaceConflictProperties ( Node n , String functionName , Map < String , ObjectType > properties , Map < String , ObjectType > currentProperties , ObjectType interfaceType ) { ObjectType implicitProto = interfaceType . getImplicitPrototype ( ) ; Set < String > currentPropertyNames ; if ( implicitProto == null ) { // This can be the case if interfaceType is proxy to a non-existent // object (which is a bad type annotation, but shouldn't crash). currentPropertyNames = ImmutableSet . of ( ) ; } else { currentPropertyNames = implicitProto . getOwnPropertyNames ( ) ; } for ( String name : currentPropertyNames ) { ObjectType oType = properties . get ( name ) ; currentProperties . put ( name , interfaceType ) ; if ( oType != null ) { JSType thisPropType = interfaceType . getPropertyType ( name ) ; JSType oPropType = oType . getPropertyType ( name ) ; if ( thisPropType . isSubtype ( oPropType , this . subtypingMode ) || oPropType . isSubtype ( thisPropType , this . subtypingMode ) || ( thisPropType . isFunctionType ( ) && oPropType . isFunctionType ( ) && thisPropType . toMaybeFunctionType ( ) . hasEqualCallType ( oPropType . toMaybeFunctionType ( ) ) ) ) { continue ; } compiler . report ( JSError . make ( n , INCOMPATIBLE_EXTENDED_PROPERTY_TYPE , functionName , name , oType . toString ( ) , interfaceType . toString ( ) ) ) ; } } for ( ObjectType iType : interfaceType . getCtorExtendedInterfaces ( ) ) { checkInterfaceConflictProperties ( n , functionName , properties , currentProperties , iType ) ; } }
Check whether there s any property conflict for for a particular super interface