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

cgen: minor cleanup for ast.clear_flags() (#18549)

This commit is contained in:
yuyi 2023-06-25 14:01:36 +08:00 committed by GitHub
parent 34ac3269bc
commit 84a5fd0051
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -3935,7 +3935,7 @@ fn (mut g Gen) unlock_locks() {
fn (mut g Gen) map_init(node ast.MapInit) { fn (mut g Gen) map_init(node ast.MapInit) {
unwrap_key_typ := g.unwrap_generic(node.key_type) unwrap_key_typ := g.unwrap_generic(node.key_type)
unwrap_val_typ := g.unwrap_generic(node.value_type).clear_flags(.result) unwrap_val_typ := g.unwrap_generic(node.value_type).clear_flag(.result)
key_typ_str := g.typ(unwrap_key_typ) key_typ_str := g.typ(unwrap_key_typ)
value_typ_str := g.typ(unwrap_val_typ) value_typ_str := g.typ(unwrap_val_typ)
value_sym := g.table.sym(unwrap_val_typ) value_sym := g.table.sym(unwrap_val_typ)

View File

@ -404,7 +404,7 @@ fn (mut g Gen) index_of_map(node ast.IndexExpr, sym ast.TypeSymbol) {
if g.inside_return { if g.inside_return {
g.typ(val_type) g.typ(val_type)
} else { } else {
g.typ(val_type.clear_flags(.result)) g.typ(val_type.clear_flag(.result))
} }
} }
get_and_set_types := val_sym.kind in [.struct_, .map, .array] get_and_set_types := val_sym.kind in [.struct_, .map, .array]