1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: remove it smartcast and replace with original variable name (#5764)

This commit is contained in:
Daniel Däschle
2020-07-09 17:14:14 +02:00
committed by GitHub
parent 9511b7d0a1
commit c5dc1a33b6
19 changed files with 210 additions and 94 deletions

View File

@ -389,13 +389,13 @@ pub fn (i &Ident) var_info() IdentVar {
pub struct InfixExpr {
pub:
op token.Kind
pos token.Position
left Expr
right Expr
op token.Kind
pos token.Position
left Expr
right Expr
pub mut:
left_type table.Type
right_type table.Type
left_type table.Type
right_type table.Type
}
pub struct PostfixExpr {
@ -443,6 +443,7 @@ pub:
comments []Comment
pub mut:
smartcast bool // should only be true if cond is `x is sumtype`, it will be set in checker - if_expr
left_as_name string // only used in x is SumType check
}
pub struct LockExpr {

View File

@ -279,7 +279,7 @@ pub fn (node Stmt) str() string {
mut out := ''
for i, left in it.left {
if left is Ident {
var_info := it.var_info()
var_info := left.var_info()
if var_info.is_mut {
out += 'mut '
}