From db5036686b039180425a8f5f62ad812c3b962842 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 13 May 2020 14:21:50 +0200 Subject: [PATCH] checker: make `type is private` warning an errror --- vlib/v/checker/checker.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 6a627b336a..86a2eee25e 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -256,7 +256,7 @@ pub fn (mut c Checker) struct_init(mut struct_init ast.StructInit) table.Type { } type_sym := c.table.get_type_symbol(struct_init.typ) if !type_sym.is_public && type_sym.kind != .placeholder && type_sym.mod != c.mod { - c.warn('type `$type_sym.name` is private', struct_init.pos) + c.error('type `$type_sym.name` is private', struct_init.pos) } // println('check struct $typ_sym.name') match type_sym.kind {