-
-
Notifications
You must be signed in to change notification settings - Fork 22k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allows to doc vararg method return type as void #34745
Allows to doc vararg method return type as void #34745
Conversation
8262e30
to
cdeb8eb
Compare
core/object.cpp
Outdated
@@ -1686,7 +1686,7 @@ void Object::_bind_methods() { | |||
mi.name = "emit_signal"; | |||
mi.arguments.push_back(PropertyInfo(Variant::STRING, "signal")); | |||
|
|||
ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "emit_signal", &Object::_emit_signal, mi); | |||
ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "emit_signal", &Object::_emit_signal, mi, Vector<Variant>(), false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other similar methods seem to use varray()
(see variant.h
) as a shorthand for Vector<Variant>()
.
For the reference, this also impacts the GDNative API in a compatibility breaking way, but I think this is OK to do before the 3.2 release (compat breakage between 3.1.x and 3.2 is expected). CC @godotengine/gdnative to confirm. --- api.json 2020-01-02 13:51:41.400082712 +0100
+++ api2.json 2020-01-02 13:55:51.671606934 +0100
@@ -95424,7 +95424,7 @@
},
{
"name": "call_deferred",
- "return_type": "Variant",
+ "return_type": "void",
"is_editor": false,
"is_noscript": false,
"is_const": false,
@@ -95555,7 +95555,7 @@
},
{
"name": "emit_signal",
- "return_type": "Variant",
+ "return_type": "void",
"is_editor": false,
"is_noscript": false,
"is_const": false,
@@ -157300,7 +157300,7 @@
"methods": [
{
"name": "add_do_method",
- "return_type": "Variant",
+ "return_type": "void",
"is_editor": false,
"is_noscript": false,
"is_const": false,
@@ -157375,7 +157375,7 @@
},
{
"name": "add_undo_method",
- "return_type": "Variant",
+ "return_type": "void",
"is_editor": false,
"is_noscript": false,
"is_const": false, |
cdeb8eb
to
4d727f1
Compare
Thanks! |
This fixes #34743
Parameter
p_return_nil_is_variant
is added tobind_vararg_method
to opt-out thePROPERTY_USAGE_NIL_IS_VARIANT
flag.Before this fix,
MethodBindVarArg
always setPROPERTY_USAGE_NIL_IS_VARIANT
for the return type.godot/core/method_bind.h
Lines 365 to 367 in 1788b22
Update: renamed
p_return_nil_as_variant
top_return_nil_is_variant
, to be consistent with the flag name.