public static void detail2(boolean serious, String tag1, Object obj1, String tag2, Object obj2) { if (serious) { TypeChecker.detail2(tag1, obj1, tag2, obj2); } }
public static void detail2(String tag1, Object obj1, String tag2, Object obj2) { TypeChecker.detail2(tag1, obj1, tag2, obj2); }
public PType checkConstraint(PType constraint, PType actual, ILexLocation location) { if (constraint != null) { if (!af.getTypeComparator().isSubType(actual, constraint, true)) { TypeChecker.report(3327, "Value is not of the right type", location); TypeChecker.detail2("Actual", actual, "Expected", constraint); } } return actual; }
public PType possibleConstraint(PType constraint, PType actual, ILexLocation location) { if (constraint != null) { if (!af.getTypeComparator().compatible(constraint, actual)) { TypeChecker.report(3327, "Value is not of the right type", location); TypeChecker.detail2("Actual", actual, "Expected", constraint); } } return actual; }
public PType checkReturnType(PType constraint, PType actual, ILexLocation location) { PTypeAssistantTC assistant = af.createPTypeAssistant(); if (constraint != null && !(actual instanceof AVoidType) && !assistant.isUnknown(actual)) { if (assistant.hasVoid(actual) && !(constraint instanceof AVoidType)) { TypeChecker.report(3328, "Statement may return void value", location); TypeChecker.detail2("Actual", actual, "Expected", constraint); } else if (!af.getTypeComparator().compatible(constraint, actual)) { TypeChecker.report(3327, "Value is not of the right type", location); TypeChecker.detail2("Actual", actual, "Expected", constraint); } } return actual; }