From be507641ffe6b95a724f08cb36110c9c190b9abe Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Tue, 21 Jan 2025 09:12:18 -0300 Subject: [PATCH] avoid checking inside for comptime for now --- 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 c58e1b842fb10a..4bbd2da888a89e 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -5293,7 +5293,8 @@ fn (mut c Checker) ensure_type_exists(typ ast.Type, pos token.Pos) bool { return false } sym := c.table.sym(typ) - if !c.is_builtin_mod && sym.kind in [.struct, .alias] && !sym.is_pub && sym.mod != c.mod { + if !c.is_builtin_mod && sym.kind in [.struct, .alias] && !sym.is_pub && sym.mod != c.mod + && c.comptime.comptime_for_field_var == '' { c.error('${sym.kind} `${sym.name}` was declared as private to module `${sym.mod}`, so it can not be used inside module `${c.mod}`', pos) return false