checker: tweak the import private function message a little
parent
78a6795319
commit
d38bca5958
|
@ -1463,7 +1463,8 @@ pub fn (mut c Checker) call_fn(mut call_expr ast.CallExpr) table.Type {
|
|||
}
|
||||
}
|
||||
if !f.is_pub && f.language == .v && f.name.len > 0 && f.mod.len > 0 && f.mod != c.mod {
|
||||
c.error('function `$f.name` is private. curmod=$c.mod fmod=$f.mod', call_expr.pos)
|
||||
c.error('function `$f.name` is private, so you can not import it in module `$c.mod`',
|
||||
call_expr.pos)
|
||||
}
|
||||
if f.is_deprecated {
|
||||
c.warn('function `$f.name` has been deprecated', call_expr.pos)
|
||||
|
|
|
@ -3,7 +3,7 @@ vlib/v/checker/tests/import_symbol_fn_private_err.vv:1:20: error: module `time`
|
|||
| ~~~~~
|
||||
2 | fn main() {
|
||||
3 | since(now())
|
||||
vlib/v/checker/tests/import_symbol_fn_private_err.vv:3:3: error: function `time.since` is private. curmod=main fmod=time
|
||||
vlib/v/checker/tests/import_symbol_fn_private_err.vv:3:3: error: function `time.since` is private, so you can not import it in module `main`
|
||||
1 | import time { now, since }
|
||||
2 | fn main() {
|
||||
3 | since(now())
|
||||
|
|
Loading…
Reference in New Issue