Skip to content

Commit 24912d2

Browse files
Autocompletion: Try to guess method return type even if subscript base has no value
1 parent abf8e1e commit 24912d2

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

modules/gdscript/gdscript_editor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1925,7 +1925,7 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context,
19251925
}
19261926
}
19271927

1928-
if (!found && base.value.get_type() != Variant::NIL) {
1928+
if (!found) {
19291929
found = _guess_method_return_type_from_base(c, base, call->function_name, r_type);
19301930
}
19311931
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[output]
2+
include=[
3+
; String
4+
{"display": "begins_with(…)"},
5+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class B:
2+
func to_str(b: int):
3+
return str(b)
4+
5+
var a: B
6+
7+
func _ready():
8+
a.to_str(10).➡
9+
pass

0 commit comments

Comments
 (0)