Merge pull request #70987 from vonagam/fix-parameter-conversion-assign

This commit is contained in:
George Marques 2023-01-12 11:34:13 -03:00 committed by GitHub
commit 75515e4303
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 56 additions and 12 deletions

View file

@ -0,0 +1,8 @@
var weakling = 'not float'
func weak(x: float = weakling):
print(x)
print('typeof x is', typeof(x))
func test():
print(typeof(weak()))
print('not ok')

View file

@ -0,0 +1,8 @@
GDTEST_RUNTIME_ERROR
>> SCRIPT ERROR
>> on function: weak()
>> runtime/errors/bad_conversion_for_default_parameter.gd
>> 2
>> Trying to assign value of type 'String' to a variable of type 'float'.
0
not ok