You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
GDScript: Fix return type of constructor call for extending class
This commit is contained in:
@@ -4174,7 +4174,7 @@ bool GDScriptAnalyzer::get_function_signature(GDScriptParser::Node *p_source, bo
|
|||||||
r_default_arg_count++;
|
r_default_arg_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
r_return_type = found_function->get_datatype();
|
r_return_type = p_is_constructor ? p_base_type : found_function->get_datatype();
|
||||||
r_return_type.is_meta_type = false;
|
r_return_type.is_meta_type = false;
|
||||||
r_return_type.is_coroutine = found_function->is_coroutine;
|
r_return_type.is_coroutine = found_function->is_coroutine;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
class A:
|
||||||
|
func _init():
|
||||||
|
pass
|
||||||
|
|
||||||
|
class B extends A: pass
|
||||||
|
class C extends A: pass
|
||||||
|
|
||||||
|
func test():
|
||||||
|
var x := B.new()
|
||||||
|
print(x is C)
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
GDTEST_ANALYZER_ERROR
|
||||||
|
Expression is of type "B" so it can't be of type "C".
|
||||||
Reference in New Issue
Block a user