private void checkFinalClassOverrides ( Node ctor ) { if ( ! isFunctionOrClass ( ctor ) ) { return ; } JSType type = ctor . getJSType ( ) . toMaybeFunctionType ( ) ; if ( type != null && type . isConstructor ( ) ) { JSType finalParentClass = getSuperClassInstanceIfFinal ( bestInstanceTypeForMethodOrCtor ( ctor ) ) ; if ( finalParentClass != null ) { compiler . report ( JSError . make ( ctor , EXTEND_FINAL_CLASS , type . getDisplayName ( ) , finalParentClass . getDisplayName ( ) ) ) ; } } }
Checks if a constructor is trying to override a final class .