mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: fix incomplete implicit ast.CastExpr{} replacements
This commit is contained in:
parent
7543b769ad
commit
bbae7a705f
@ -501,6 +501,7 @@ pub fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) {
|
|||||||
expr: node.left[0]
|
expr: node.left[0]
|
||||||
typ: modified_left_type
|
typ: modified_left_type
|
||||||
typname: c.table.type_str(modified_left_type)
|
typname: c.table.type_str(modified_left_type)
|
||||||
|
expr_type: left_type
|
||||||
pos: node.pos
|
pos: node.pos
|
||||||
}
|
}
|
||||||
op: .right_shift
|
op: .right_shift
|
||||||
|
@ -36,6 +36,7 @@ pub fn (mut c Checker) infix_expr(mut node ast.InfixExpr) ast.Type {
|
|||||||
typ: left_type
|
typ: left_type
|
||||||
typname: c.table.get_type_name(left_type)
|
typname: c.table.get_type_name(left_type)
|
||||||
expr_type: right_type
|
expr_type: right_type
|
||||||
|
pos: node.right.pos()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -512,6 +513,7 @@ pub fn (mut c Checker) infix_expr(mut node ast.InfixExpr) ast.Type {
|
|||||||
expr: node.left
|
expr: node.left
|
||||||
typ: modified_left_type
|
typ: modified_left_type
|
||||||
typname: c.table.type_str(modified_left_type)
|
typname: c.table.type_str(modified_left_type)
|
||||||
|
expr_type: left_type
|
||||||
pos: node.pos
|
pos: node.pos
|
||||||
}
|
}
|
||||||
left_type: left_type
|
left_type: left_type
|
||||||
|
@ -104,6 +104,7 @@ pub fn (mut c Checker) return_stmt(mut node ast.Return) {
|
|||||||
typname: 'IError'
|
typname: 'IError'
|
||||||
typ: ast.error_type
|
typ: ast.error_type
|
||||||
expr_type: got_typ
|
expr_type: got_typ
|
||||||
|
pos: node.pos
|
||||||
}
|
}
|
||||||
node.types[0] = ast.error_type
|
node.types[0] = ast.error_type
|
||||||
return
|
return
|
||||||
@ -161,6 +162,7 @@ pub fn (mut c Checker) return_stmt(mut node ast.Return) {
|
|||||||
typname: 'IError'
|
typname: 'IError'
|
||||||
typ: ast.error_type
|
typ: ast.error_type
|
||||||
expr_type: got_typ
|
expr_type: got_typ
|
||||||
|
pos: node.pos
|
||||||
}
|
}
|
||||||
node.types[expr_idxs[i]] = ast.error_type
|
node.types[expr_idxs[i]] = ast.error_type
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user