From 8077a7534ef7ec1683f8edd9f0cc380eae6b4f68 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Fri, 20 Mar 2020 20:22:34 +0100 Subject: [PATCH] cgen: 7 errors left --- vlib/v/parser/parser.v | 6 +++++- vlib/v/table/table.v | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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