From 081338b8bf061bee43c36eb3dfb6a2a34cc91a16 Mon Sep 17 00:00:00 2001 From: Steve Phillips Date: Mon, 4 May 2020 15:20:32 -0700 Subject: [PATCH] checker.v: suggest []Type{}, not []Type --- vlib/v/checker/checker.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 316544e1a8..c8ab20210e 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -1133,12 +1133,12 @@ pub fn (mut c Checker) array_init(array_init mut ast.ArrayInit) table.Type { } type_sym := c.table.get_type_symbol(c.expected_type) if type_sym.kind != .array { - c.error('array_init: no type specified (maybe: `[]Type` instead of `[]`)', array_init.pos) + c.error('array_init: no type specified (maybe: `[]Type{}` instead of `[]`)', array_init.pos) return table.void_type } // TODO: seperate errors once bug is fixed with `x := if expr { ... } else { ... }` // if c.expected_type == table.void_type { - // c.error('array_init: use `[]Type` instead of `[]`', array_init.pos) + // c.error('array_init: use `[]Type{}` instead of `[]`', array_init.pos) // return table.void_type // } array_info := type_sym.array_info()