@ Check ( CheckType . FAST ) public void checkBehaviorUnitGuardType ( SarlBehaviorUnit behaviorUnit ) { final XExpression guard = behaviorUnit . getGuard ( ) ; if ( guard != null ) { if ( this . operationHelper . hasSideEffects ( null , guard ) ) { error ( Messages . SARLValidator_53 , guard , null , ValidationMessageAcceptor . INSIGNIFICANT_INDEX , INVALID_INNER_EXPRESSION ) ; return ; } if ( guard instanceof XBooleanLiteral ) { final XBooleanLiteral booleanLiteral = ( XBooleanLiteral ) guard ; if ( booleanLiteral . isIsTrue ( ) ) { if ( ! isIgnored ( DISCOURAGED_BOOLEAN_EXPRESSION ) ) { addIssue ( Messages . SARLValidator_54 , booleanLiteral , null , ValidationMessageAcceptor . INSIGNIFICANT_INDEX , DISCOURAGED_BOOLEAN_EXPRESSION ) ; } } else if ( ! isIgnored ( UNREACHABLE_BEHAVIOR_UNIT ) ) { addIssue ( Messages . SARLValidator_55 , behaviorUnit , null , ValidationMessageAcceptor . INSIGNIFICANT_INDEX , UNREACHABLE_BEHAVIOR_UNIT , behaviorUnit . getName ( ) . getSimpleName ( ) ) ; } return ; } final LightweightTypeReference fromType = getActualType ( guard ) ; if ( ! fromType . isAssignableFrom ( Boolean . TYPE ) ) { error ( MessageFormat . format ( Messages . SARLValidator_38 , getNameOfTypes ( fromType ) , boolean . class . getName ( ) ) , guard , null , ValidationMessageAcceptor . INSIGNIFICANT_INDEX , INCOMPATIBLE_TYPES ) ; } } }
Check the type of the behavior unit s guard .