mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: cleanup smartcasts in the compiler (#13639)
This commit is contained in:
@@ -935,8 +935,8 @@ pub fn (mut t Transformer) if_expr(mut node ast.IfExpr) ast.Expr {
|
||||
stmt = t.stmt(mut stmt)
|
||||
|
||||
if i == branch.stmts.len - 1 {
|
||||
if stmt is ast.ExprStmt {
|
||||
expr := (stmt as ast.ExprStmt).expr
|
||||
if mut stmt is ast.ExprStmt {
|
||||
expr := stmt.expr
|
||||
|
||||
match expr {
|
||||
ast.IfExpr {
|
||||
@@ -976,8 +976,8 @@ pub fn (mut t Transformer) match_expr(mut node ast.MatchExpr) ast.Expr {
|
||||
stmt = t.stmt(mut stmt)
|
||||
|
||||
if i == branch.stmts.len - 1 {
|
||||
if stmt is ast.ExprStmt {
|
||||
expr := (stmt as ast.ExprStmt).expr
|
||||
if mut stmt is ast.ExprStmt {
|
||||
expr := stmt.expr
|
||||
|
||||
match expr {
|
||||
ast.IfExpr {
|
||||
|
||||
Reference in New Issue
Block a user