You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code causes a compiler crash, where the case in the match expression is unnecessarily surrounded by parenthesis:
type Alias is ((Object, Object) | String)
class Object
actor Main
var tuple: Alias
new create(env: Env) =>
tuple = ""
match tuple
| (var leaf: String) => env.stdout.print("Leaf!")
end
(lldb) p ast_print(ast_parent(pattern))
(tuple
(seq
(var
(idseq ((id leaf) [nominal (id $1) (id String) x val x x]) [nominal (id $1) (id String) x val x x])
(nominal (id $1) (id String) x val x x)
[nominal (id $1) (id String) x val x x]
)
[nominal (id $1) (id String) x val x x]
)
[nominal (id $1) (id String) x val x x]
)
Whereas removing the parenthesis around "var leaf: String" makes the code compile.
type Alias is ((Object, Object) | String)
class Object
actor Main
var tuple: Alias
new create(env: Env) =>
tuple = ""
match tuple
| var leaf: String => env.stdout.print("Leaf!")
end
The text was updated successfully, but these errors were encountered:
The following code causes a compiler crash, where the case in the match expression is unnecessarily surrounded by parenthesis:
Whereas removing the parenthesis around "var leaf: String" makes the code compile.
The text was updated successfully, but these errors were encountered: