checker: make `type is private` warning an errror

pull/4880/head
Alexander Medvednikov 2020-05-13 14:21:50 +02:00
parent b1511ce995
commit db5036686b
1 changed files with 1 additions and 1 deletions

View File

@ -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 {