Don't include location in a message about binding function to a type

This commit is contained in:
wechman
2022-11-07 17:13:09 +01:00
committed by Kamil Śliwak
parent d5428af5bb
commit 4c9a58eb0f
3 changed files with 8 additions and 3 deletions
+2 -2
View File
@@ -3798,7 +3798,7 @@ void TypeChecker::endVisit(UsingForDirective const& _usingFor)
path->location(),
"The function \"" + joinHumanReadable(path->path(), ".") + "\" " +
"does not have any parameters, and therefore cannot be bound to the type \"" +
(normalizedType ? normalizedType->humanReadableName() : "*") + "\"."
(normalizedType ? normalizedType->toString(true /* withoutDataLocation */) : "*") + "\"."
);
FunctionType const* functionType = dynamic_cast<FunctionType const&>(*functionDefinition.type()).asBoundFunction();
@@ -3811,7 +3811,7 @@ void TypeChecker::endVisit(UsingForDirective const& _usingFor)
3100_error,
path->location(),
"The function \"" + joinHumanReadable(path->path(), ".") + "\" "+
"cannot be bound to the type \"" + _usingFor.typeName()->annotation().type->humanReadableName() +
"cannot be bound to the type \"" + _usingFor.typeName()->annotation().type->toString(true /* withoutDataLocation */) +
"\" because the type cannot be implicitly converted to the first argument" +
" of the function (\"" + functionType->selfType()->humanReadableName() + "\")" +
(