mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: tweak the import private function message a little
This commit is contained in:
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 {
|
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 {
|
if f.is_deprecated {
|
||||||
c.warn('function `$f.name` has been deprecated', call_expr.pos)
|
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() {
|
2 | fn main() {
|
||||||
3 | since(now())
|
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 }
|
1 | import time { now, since }
|
||||||
2 | fn main() {
|
2 | fn main() {
|
||||||
3 | since(now())
|
3 | since(now())
|
||||||
|
Loading…
Reference in New Issue
Block a user