diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index d70a0c2d0c..b002490933 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -1696,10 +1696,14 @@ fn (p mut Parser) match_expr() ast.MatchExpr { else if p.tok.kind == .name && (p.tok.lit[0].is_capital() || p.peek_tok.kind == .dot) { // if sym.kind == .sum_type { // p.warn('is sum') + // TODO `exprs << ast.Type{...}` typ := p.parse_type() - exprs << ast.Type{ + x := ast.Type{ typ: typ } + mut expr := ast.Expr{} + expr = x + exprs << expr p.scope.register_var(ast.Var{ name: 'it' typ: table.type_to_ptr(typ) diff --git a/vlib/v/table/table.v b/vlib/v/table/table.v index aeb2101a32..94793c6e02 100644 --- a/vlib/v/table/table.v +++ b/vlib/v/table/table.v @@ -232,7 +232,7 @@ pub fn (t mut Table) register_builtin_type_symbol(typ TypeSymbol) int { if existing_idx > 0 { if existing_idx >= string_type_idx { if existing_idx == string_type_idx { - existing_type := &t.types[existing_idx] + existing_type := t.types[existing_idx] t.types[existing_idx] = { typ | kind:existing_type.kind