diff --git a/libs/interpreter/source/eval.cpp b/libs/interpreter/source/eval.cpp index 0640511..55f2997 100644 --- a/libs/interpreter/source/eval.cpp +++ b/libs/interpreter/source/eval.cpp @@ -511,7 +511,16 @@ namespace pslang::interpreter if (identifier) { if (auto type = types::builtin_type(identifier->name)) - return zero_value(context, *type); + { + if (function_call.arguments.empty()) + return zero_value(context, *type); + + std::ostringstream os; + os << "Cannot create built-in type "; + types::print(os, *type); + os << ": expected 0 arguments, but got " << function_call.arguments.size(); + throw std::runtime_error(os.str()); + } for (auto it = context.scope_stack.rbegin(); it != context.scope_stack.rend(); ++it) {