1
0
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:
yuyi
2022-03-03 16:48:31 +08:00
committed by GitHub
parent 4e7db5bab0
commit 288b13b51d
6 changed files with 23 additions and 31 deletions

View File

@@ -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 {