File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -614,7 +614,15 @@ fn (mut g Gen) infix_expr_in_op(node ast.InfixExpr) {
614614 } else if right.unaliased_sym.kind == .map {
615615 g.write ('_IN_MAP(' )
616616 if ! left.typ.is_ptr () {
617- styp := g.styp (node.left_type)
617+ mut sym_map := g.table.sym (node.right_type)
618+ if sym_map.info is ast.Alias {
619+ sym_map = g.table.sym ((sym_map.info as ast.Alias ).parent_type)
620+ }
621+ styp := g.styp (if sym_map.info is ast.Map {
622+ (sym_map.info as ast.Map ).key_type
623+ } else {
624+ node.left_type
625+ })
618626 g.write ('ADDR(${styp }, ' )
619627 g.expr (node.left)
620628 g.write (')' )
Original file line number Diff line number Diff line change 1+ import datatypes
2+
3+ fn x () {
4+ mut set1 := datatypes.Set[string ]{}
5+ set1 .add ('' )
6+ assert set1 .exists ('' )
7+ }
8+
9+ fn y () {
10+ mut set2 := datatypes.Set[int ]{}
11+ set2 .add (1 )
12+ assert set2 .exists (1 )
13+ }
14+
15+ fn test_main () {
16+ x ()
17+ y ()
18+ }
You can’t perform that action at this time.
0 commit comments