diff options
| author | Danil Alexeev <danil@alexeev.xyz> | 2024-07-22 21:45:01 +0300 |
|---|---|---|
| committer | Danil Alexeev <danil@alexeev.xyz> | 2024-07-22 21:45:01 +0300 |
| commit | 638148a184e9526bf3519de44e5f34791604b50b (patch) | |
| tree | 8a7f3bf8b1a4edffc487637ee9245cb308ecd255 /modules/gdscript/tests/scripts/analyzer | |
| parent | 4e5ed0bbfb56f0a71eb61c868f965476652c23df (diff) | |
| download | redot-engine-638148a184e9526bf3519de44e5f34791604b50b.tar.gz | |
GDScript: Fix false positive cases of `ENUM_VARIABLE_WITHOUT_DEFAULT`
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer')
| -rw-r--r-- | modules/gdscript/tests/scripts/analyzer/warnings/enum_without_default_value.gd | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/warnings/enum_without_default_value.gd b/modules/gdscript/tests/scripts/analyzer/warnings/enum_without_default_value.gd index 13e3edf93f..f3a8661acf 100644 --- a/modules/gdscript/tests/scripts/analyzer/warnings/enum_without_default_value.gd +++ b/modules/gdscript/tests/scripts/analyzer/warnings/enum_without_default_value.gd @@ -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) |
