You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several error messages which use word Nil, but there are no Nils in GDScript. I suggest that those error messages should be changed to use the correct term null.
Some error messages also somewhat incorrectly talk about Nil/null being a type while it actually isn't. I have made a proposal to fix the null/void types. This bug report is however just about fixing the confusing error messages.
Steps to reproduce
example 1
vara: int=null
Current error message:
Trying to assign value of type 'Nil' to a variable of type 'int'.
This is especially bad error message as a type null/Nil doesn't actually exist. Better error message would be:
Trying to assign 'null' to a variable of type 'int'. Only assigning 'int' is allowed.
example 2
vara=nulla.foo()
Current error message:
Invalid call. Nonexistent function 'foo' in base 'Nil'.
Better error message could be something like this:
'a' is 'null' so its methods cannot be called.
There are surely more error messages which use word Nil, but these are ones I have noticed so far.
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered:
Nil is technically a Variant type (albeit it's not exposed for use in scripting), with only one value: null. The error message is valid, but I agree it's confusing.
Nil is technically a Variant type (albeit it's not exposed for use in scripting), with only one value: null. The error message is valid, but I agree it's confusing.
Yes, it is confusing. Neither of these don't work:
vara: Nil=nullvara: null=null
Of course, I wouldn't expect the first line to work if Nil is not exposed to scripting, but the documentation says
null is an empty data type that contains no information and can not be assigned any other value.
(apparently incorrectly) that null is a type, so I might expect that the second line would work.
Godot version
v4.0.alpha8.official [cc3ed63]
System information
Windows 10
Issue description
There are several error messages which use word
Nil
, but there are noNil
s in GDScript. I suggest that those error messages should be changed to use the correct termnull
.Some error messages also somewhat incorrectly talk about
Nil
/null
being a type while it actually isn't. I have made a proposal to fix the null/void types. This bug report is however just about fixing the confusing error messages.Steps to reproduce
example 1
Current error message:
This is especially bad error message as a type
null
/Nil
doesn't actually exist. Better error message would be:example 2
Current error message:
Better error message could be something like this:
There are surely more error messages which use word
Nil
, but these are ones I have noticed so far.Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: