the statement works fine outside of the lambda function, something like print() or other useful code still create an error. i appreciate your input though
func _ready() -> void:
var n = func():
match 0:
0: print("test")
n.call()
In fact it is the use of brackets that is causing your error:
This gives me your error:
func _ready() -> void:
var n = (func():
match 0:
0: print("test"))
n.call()
I am thinking that this is a bug and cousin to this reported bug.
The error goes away if you move the closing bracket out of the match statement.
This reports no error:
func _ready() -> void:
var n = (func():
match 0:
0: print("test")
)
n.call()
I am going to post this as a reply to that bug. I now think it is the same bug.