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
In 4.x, multilevel calls are removed and and constructor syntax is no different from other methods now, so requiring a call to super() looks wrong to me.
As for the exception for constructor, this behavior exists in some other languages as well. For example PHP:
I'm not sure what the behavior in GDScript should be here. Perhaps this should be a warning, not an error.
For other custom methods, the signature is checked:
classA:
functest(p):
passclassBextendsA:
# Error: The function signature doesn't match the parent. Parent signature is "test(Variant) -> Variant".functest():
pass
It is indeed a bug, it should raise an error if the super class constructor requires an argument that is not being provided. This can be checked at compile time and should show an error in the editor. I'll try to keep in my shortlist for 4.0 but it's so close I won't really promise it.
Godot version: v4.0.dev.custom_build 5ba46dd
OS/device including version: windows 10
Issue description:
it should remind to call
super()
if base class doesn't have any default constructorThe text was updated successfully, but these errors were encountered: