GDScript: Fix return type checking for inferred function type
This commit is contained in:
parent
fe6f78a4c7
commit
566d86d081
1 changed files with 1 additions and 1 deletions
|
|
@ -2569,7 +2569,7 @@ void GDScriptAnalyzer::resolve_return(GDScriptParser::ReturnNode *p_return) {
|
|||
result.is_constant = true;
|
||||
}
|
||||
|
||||
if (has_expected_type && !expected_type.is_variant()) {
|
||||
if (has_expected_type && !expected_type.is_variant() && expected_type.is_hard_type()) {
|
||||
if (result.is_variant() || !result.is_hard_type()) {
|
||||
mark_node_unsafe(p_return);
|
||||
if (!is_type_compatible(expected_type, result, true, p_return)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue