GDScript: Fix false positive cases of ENUM_VARIABLE_WITHOUT_DEFAULT
This commit is contained in:
parent
4e5ed0bbfb
commit
638148a184
2 changed files with 16 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue