checker: check if imported struct is public (#6425)

pull/6032/head
Henrixounez 2020-09-19 17:16:43 +02:00 committed by GitHub
parent 4121ba9ea9
commit 4b0e7fc979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2363,7 +2363,7 @@ fn (mut c Checker) import_stmt(imp ast.Import) {
} }
if sym.kind == .type_ { if sym.kind == .type_ {
if type_sym := c.table.find_type(name) { if type_sym := c.table.find_type(name) {
if type_sym.kind == .placeholder { if type_sym.kind == .placeholder || !type_sym.is_public {
c.error('module `$imp.mod` has no public type `$sym.name\{}`', sym.pos) c.error('module `$imp.mod` has no public type `$sym.name\{}`', sym.pos)
} }
} else { } else {