virtualx-engine/modules/gdscript/tests/scripts/parser/warnings
20kdc 24181d1055
GDScript: Adjust STATIC_CALLED_ON_INSTANCE warning to not default to the native type, and to not trigger on self-calls
Not defaulting to the native type rationale:

Defaulting to the native type is less than useful, as:

* There are very few native types that are extensible and have static methods.
* Defaulting to the native type does not account for a method being script-defined.

While the "real fix" would be to carefully track the source of the method, the get_function_signature method is already complicated enough.

This will at least ensure the resulting code should always be valid.

Not triggering on self-calls rationale:

Found in PR comment https://github.com/godotengine/godot/pull/85918#issuecomment-1935864459

```
static func example():
	pass

func example2():
	example() # self-call on static function
```

Disabling this warning on self-calls is:

* Consistent with other languages
* Important for anonymous classes (where the output code is unusable)
2024-03-01 17:14:59 +03:00
..
assert_always_true.gd
assert_always_true.out
confusable_identifier.gd
confusable_identifier.out
deprecated_operators.gd
deprecated_operators.out
empty_file.notest.gd
empty_file.notest.out
empty_file_comment.notest.gd
empty_file_comment.notest.out
empty_file_newline.notest.gd
empty_file_newline.notest.out
empty_file_newline_comment.notest.gd
empty_file_newline_comment.notest.out
enum_assign_int_without_casting.gd
enum_assign_int_without_casting.out
incompatible_ternary.gd
incompatible_ternary.out
integer_division.gd
integer_division.out
match_default_not_at_end.gd
match_default_not_at_end.out
narrowing_conversion.gd
narrowing_conversion.out
return_value_discarded.gd
return_value_discarded.out
shadowed_constant.gd
shadowed_constant.out
shadowed_global_identifier.gd
shadowed_global_identifier.out
shadowed_variable_class.gd
shadowed_variable_class.out
shadowed_variable_function.gd
shadowed_variable_function.out
standalone_expression.gd
standalone_expression.out
static_called_on_instance.gd
static_called_on_instance.out
unassigned_variable.gd
unassigned_variable.out
unassigned_variable_op_assign.gd
unassigned_variable_op_assign.out
unreachable_code_after_return.gd
unreachable_code_after_return.out
unreachable_code_after_return_bug_55154.gd
unreachable_code_after_return_bug_55154.out
unused_argument.gd
unused_argument.out
unused_variable.gd
unused_variable.out