From 6c56528cd70f76cf39a5aec8b63f207d82708a86 Mon Sep 17 00:00:00 2001 From: Joe Conigliaro Date: Thu, 19 Mar 2020 19:52:33 +1100 Subject: [PATCH] checker: update assoc type --- vlib/v/ast/ast.v | 3 ++- vlib/v/checker/checker.v | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/vlib/v/ast/ast.v b/vlib/v/ast/ast.v index 72206e9385..3366f593bb 100644 --- a/vlib/v/ast/ast.v +++ b/vlib/v/ast/ast.v @@ -594,11 +594,12 @@ pub: pub struct Assoc { pub: - typ table.Type var_name string fields []string exprs []Expr pos token.Position +mut: + typ table.Type } pub struct SizeOf { diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 9cc2229257..8302f4bba0 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -649,6 +649,7 @@ pub fn (c mut Checker) expr(node ast.Expr) table.Type { for i, _ in it.fields { c.expr(it.exprs[i]) } + it.typ = var.typ return var.typ } ast.BoolLiteral {