GDScript: Fix false positive cases of ENUM_VARIABLE_WITHOUT_DEFAULT

This commit is contained in:
Danil Alexeev
2024-07-22 21:45:01 +03:00
parent 4e5ed0bbfb
commit 638148a184
2 changed files with 16 additions and 2 deletions

View File

@@ -7,3 +7,17 @@ var has_no_zero: HasNoZero # Warning, because there is no `0` in the enum.
func test():
print(has_zero)
print(has_no_zero)
# GH-94634. A parameter is either mandatory or has a default value.
func test_no_exec(param: HasNoZero) -> void:
print(param)
# Loop iterator always has a value.
for i: HasNoZero in HasNoZero.values():
print(i)
match param:
# Pattern bind always has a value.
var x:
print(x)