Merge pull request #74689 from vonagam/fix-autocomplete-after-type-test

GDScript: Fix autocomplete inside a block with a type test condition
This commit is contained in:
Rémi Verschelde 2023-03-10 22:47:55 +01:00
commit 567dc78e62
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1956,7 +1956,7 @@ static bool _guess_identifier_type(GDScriptParser::CompletionContext &p_context,
GDScriptParser::CompletionContext c = p_context;
c.current_line = type_test->operand->start_line;
c.current_suite = suite;
if ((!id_type.is_set() || id_type.is_variant()) && type_test->test_datatype.is_hard_type()) {
if (type_test->test_datatype.is_hard_type()) {
id_type = type_test->test_datatype;
if (last_assign_line < c.current_line) {
// Override last assignment.