Search in sources :

Example 6 with ValidationIssue

use of org.yakindu.base.types.validation.IValidationIssueAcceptor.ValidationIssue in project statecharts by Yakindu.

the class TypeValidator method assertIsSubType.

public void assertIsSubType(InferenceResult subResult, InferenceResult superResult, String msg, IValidationIssueAcceptor acceptor) {
    if (subResult == null || superResult == null)
        return;
    if (!registry.isSuperType(subResult.getType(), superResult.getType())) {
        msg = msg != null ? msg : String.format(ASSERT_COMPATIBLE, subResult, superResult);
        acceptor.accept(new ValidationIssue(Severity.ERROR, msg, NOT_COMPATIBLE_CODE));
    }
}
Also used : ValidationIssue(org.yakindu.base.types.validation.IValidationIssueAcceptor.ValidationIssue)

Aggregations

ValidationIssue (org.yakindu.base.types.validation.IValidationIssueAcceptor.ValidationIssue)6 InferenceResult (org.yakindu.base.types.inferrer.ITypeSystemInferrer.InferenceResult)2