1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
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

View File

@ -2363,7 +2363,7 @@ fn (mut c Checker) import_stmt(imp ast.Import) {
}
if sym.kind == .type_ {
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)
}
} else {