Merge pull request #115829 from dalexeev/gds-fix-return-codegen

GDScript: Fix compiler generates incorrect bytecode for conversion return
This commit is contained in:
Rémi Verschelde
2026-03-23 22:33:57 +01:00
14 changed files with 164 additions and 129 deletions
+2 -3
View File
@@ -439,10 +439,9 @@ void GDScriptDocGen::_generate_docs(GDScript *p_script, const GDP::ClassNode *p_
method_doc.qualifiers += "static";
}
if (func_name == "_init") {
if (func_name == "_init" || func_name == "_static_init") {
method_doc.return_type = "void";
} else if (m_func->return_type) {
// `m_func->return_type->get_datatype()` is a metatype.
} else if (!m_func->get_datatype().is_variant()) {
_doctype_from_gdtype(m_func->get_datatype(), method_doc.return_type, method_doc.return_enum, true);
} else if (!m_func->body->has_return) {
// If no `return` statement, then return type is `void`, not `Variant`.