Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | robertop | |
Old Version | Published before Godot 3 was released. |
Sorry for the beginner question, but I have the follow code:
func _checkResult():
var tam = defenseSeq.length()
match tam:
0: print("Teste 0")
1: print("Teste 1")
And the Godot show the follow error:
Parser Error: Expected end of statement after expression.
And the line is the line of “match tam:”
I don’t understand the problem
That looks like a bug. Try var x = match tan: ...
?
Is it Godot master branch?
Zylann | 2017-01-20 12:46
If I put
var x = match defenseSeq[tam-1]:
the error is Parser Error: Expected end of statement (var)
I using the RELEASED 2016/11/17. The oficial stable version.
robertop | 2017-01-20 13:22
Just was going to ask, match
is on stable?
eons | 2017-01-20 14:29