GDScript: Fix incorrect error message for utility functions

This commit is contained in:
Danil Alexeev
2023-06-30 20:40:02 +03:00
parent a574c0296b
commit 0c2202c56e
13 changed files with 167 additions and 59 deletions

View File

@@ -0,0 +1,3 @@
func test():
var x = Color()
print(len(x)) # GDScript utility function.

View File

@@ -0,0 +1,6 @@
GDTEST_RUNTIME_ERROR
>> SCRIPT ERROR
>> on function: test()
>> runtime/errors/gd_utility_function_wrong_arg.gd
>> 3
>> Error calling GDScript utility function "len()": Value of type 'Color' can't provide a length.

View File

@@ -0,0 +1,3 @@
func test():
var x = Color()
print(floor(x)) # Built-in utility function.

View File

@@ -0,0 +1,6 @@
GDTEST_RUNTIME_ERROR
>> SCRIPT ERROR
>> on function: test()
>> runtime/errors/utility_function_wrong_arg.gd
>> 3
>> Error calling utility function "floor()": Argument "x" must be "int", "float", "Vector2", "Vector2i", "Vector3", "Vector3i", "Vector4", or "Vector4i".