checker: make `type is private` warning an errror
parent
b1511ce995
commit
db5036686b
|
@ -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)
|
type_sym := c.table.get_type_symbol(struct_init.typ)
|
||||||
if !type_sym.is_public && type_sym.kind != .placeholder && type_sym.mod != c.mod {
|
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')
|
// println('check struct $typ_sym.name')
|
||||||
match type_sym.kind {
|
match type_sym.kind {
|
||||||
|
|
Loading…
Reference in New Issue