mirror of
https://github.com/godotengine/godot.git
synced 2025-01-30 21:10:22 +08:00
9462ae4783
The keyword is confusing and rarely is used in the intended way. It is removed now in favor of a future feature (pattern guards) to avoid breaking compatibility later.
17 lines
215 B
GDScript
17 lines
215 B
GDScript
func test():
|
|
var i = "Hello"
|
|
match i:
|
|
"Hello":
|
|
print("hello")
|
|
"Good bye":
|
|
print("bye")
|
|
_:
|
|
print("default")
|
|
|
|
var j = 25
|
|
match j:
|
|
26:
|
|
print("This won't match")
|
|
_:
|
|
print("This will match")
|