From 0c2984ff93c82139bf9d3c6add03dd8befbc79cc Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Fri, 15 Apr 2022 20:40:23 +0300 Subject: [PATCH] parser: do not allow [x]byte{} --- vlib/v/parser/containers.v | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vlib/v/parser/containers.v b/vlib/v/parser/containers.v index f925f942b9..aa845db940 100644 --- a/vlib/v/parser/containers.v +++ b/vlib/v/parser/containers.v @@ -68,6 +68,9 @@ fn (mut p Parser) array_init() ast.ArrayInit { if exprs.len == 1 && p.tok.kind in [.name, .amp, .lsbr] && p.tok.line_nr == line_nr { // [100]u8 elem_type = p.parse_type() + if p.table.sym(elem_type).name == 'byte' { + p.error('`byte` has been deprecated in favor of `u8`: use `[10]u8` instead of `[10]byte`') + } last_pos = p.tok.pos() is_fixed = true if p.tok.kind == .lcbr {