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
I was converting a Godot 3.5 project of mine to Godot 4 and found the following code throws an error:
vardims : set = set_dimsfuncset_dims(_dims, some_arg=null):
{
print(some_arg)
dims=_dims
}
Error: Function "set_dims" cannot be used as setter because of its signature.
I can luckily get the functionality to work with alternative syntax, but it's a bit silly and overly verbose when you have a lot of setters that should otherwise be very simple. It impacts readability quite a bit.
For example, the following:
vardims : set = set_dimsvarsurface : set = set_surfacevarcounts : set = set_countsvarbedrock : set = set_bedrockvarsize : set = set_size
I can't see any particular reason for this not to work, seeing as normal function calls can call functions without overriding default values. I'd probably call this a regression.
I found an issue back from 3.1 beta10, which seems to be when the original functionality was implemented: #26530
Steps to reproduce
The sample code from above should do it:
vardims : set = set_dimsfuncset_dims(_dims, some_arg=null):
{
print(some_arg)
dims=_dims
}
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered:
Godot version
4.0-rc6_win64
System information
Windows 10
Issue description
I was converting a Godot 3.5 project of mine to Godot 4 and found the following code throws an error:
I can luckily get the functionality to work with alternative syntax, but it's a bit silly and overly verbose when you have a lot of setters that should otherwise be very simple. It impacts readability quite a bit.
For example, the following:
Becomes this:
I can't see any particular reason for this not to work, seeing as normal function calls can call functions without overriding default values. I'd probably call this a regression.
I found an issue back from 3.1 beta10, which seems to be when the original functionality was implemented: #26530
Steps to reproduce
The sample code from above should do it:
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: