mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Merge pull request #72285 from vnen/gdscript-variable-match
GDScript: Allow variables in match patterns
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
func test():
|
||||
var dict = { a = 1 }
|
||||
match 2:
|
||||
dict["a"]:
|
||||
print("not allowed")
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Expression in match pattern must be a constant expression, an identifier, or an attribute access ("A.B").
|
||||
@@ -0,0 +1,5 @@
|
||||
func test():
|
||||
var a = 1
|
||||
match 2:
|
||||
a + 2:
|
||||
print("not allowed")
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Expression in match pattern must be a constant expression, an identifier, or an attribute access ("A.B").
|
||||
Reference in New Issue
Block a user