mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
make private struct warning an error
This commit is contained in:
@ -62,7 +62,7 @@ fn (p mut Parser) get_type2() Type {
|
||||
// Register anon fn type
|
||||
fn_typ := Type{
|
||||
name: f.typ_str() // 'fn (int, int) string'
|
||||
|
||||
|
||||
mod: p.mod
|
||||
func: f
|
||||
cat: .func
|
||||
|
@ -342,7 +342,7 @@ fn (p mut Parser) struct_init(typ_ string) string {
|
||||
mut typ := typ_
|
||||
mut t := p.table.find_type(typ)
|
||||
if !t.is_public && t.mod != p.mod {
|
||||
p.warn('type `$t.name` is private')
|
||||
p.error('struct `$t.name` is private')
|
||||
}
|
||||
// generic struct init
|
||||
if p.peek() == .lt {
|
||||
|
Reference in New Issue
Block a user