diff --git a/libs/ast/source/type_check.cpp b/libs/ast/source/type_check.cpp index e180935..73d1152 100644 --- a/libs/ast/source/type_check.cpp +++ b/libs/ast/source/type_check.cpp @@ -542,7 +542,7 @@ namespace pslang::ast std::string function_name; if (auto identifier = std::get_if(node.function.get())) - function_name = identifier->name + " "; + function_name = "\"" + identifier->name + "\" "; auto function_type = get_type(*node.function); @@ -558,7 +558,7 @@ namespace pslang::ast if (ftype->arguments.size() != node.arguments.size()) { std::ostringstream os; - os << "Cannot call function " << function_name << " of type "; + os << "Cannot call function " << function_name << "of type "; print(os, *function_type); os << ": expected " << ftype->arguments.size() << " arguments, but got " << node.arguments.size(); throw type_error(os.str(), node.location); @@ -570,7 +570,7 @@ namespace pslang::ast if (!types::equal(*arg_type, *ftype->arguments[i])) { std::ostringstream os; - os << "Cannot call function " << function_name << " of type "; + os << "Cannot call function " << function_name << "of type "; print(os, *function_type); os << ": argument #" << i << " expected to have type "; print(os, *ftype->arguments[i]);