Remove the inaccurate Type::categoryName() and change the error message for invalid calls to one independent of the category

This commit is contained in:
Kamil Śliwak
2023-04-20 13:50:22 +02:00
parent a77d4e281f
commit 34da6c8811
16 changed files with 13 additions and 57 deletions
+1 -5
View File
@@ -2847,11 +2847,7 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
}
default:
m_errorReporter.fatalTypeError(
5704_error,
_functionCall.location(),
capitalized(Type::categoryName(expressionType->category())) + " is not callable."
);
m_errorReporter.fatalTypeError(5704_error, _functionCall.location(), "This expression is not callable.");
// Unreachable, because fatalTypeError throws. We don't set kind, but that's okay because the switch below
// is never reached. And, even if it was, SetOnce would trigger an assertion violation and not UB.
funcCallAnno.isPure = argumentsArePure;