mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
GDScript: Fix false positive cases of ENUM_VARIABLE_WITHOUT_DEFAULT
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user