From 0b5419696228ecb209dcec100fc65d8b62d9bbe6 Mon Sep 17 00:00:00 2001 From: playX Date: Sat, 30 Apr 2022 14:30:55 +0000 Subject: [PATCH] checker: allow pointer index for translated code (#14231) --- vlib/v/checker/checker.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 8dd4635814..0f0f683d6b 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -3809,7 +3809,8 @@ fn (mut c Checker) check_index(typ_sym &ast.TypeSymbol, index ast.Expr, index_ty if typ_sym.kind in [.array, .array_fixed, .string] { if !(index_type.is_int() || index_type_sym.kind == .enum_ || (index_type_sym.kind == .alias - && (index_type_sym.info as ast.Alias).parent_type.is_int())) { + && (index_type_sym.info as ast.Alias).parent_type.is_int()) + || (c.pref.translated && index_type.is_any_kind_of_pointer())) { type_str := if typ_sym.kind == .string { 'non-integer string index `$index_type_sym.name`' } else {