checker: make an error using non `pub` fns from other modules
parent
ebbf42dadb
commit
481f103dc9
|
@ -940,10 +940,7 @@ pub fn (s string) trim_suffix(str string) string {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// fn print_cur_thread() {
|
pub fn compare_strings(a, b &string) int {
|
||||||
// //C.printf("tid = %08x \n", pthread_self());
|
|
||||||
// }
|
|
||||||
fn compare_strings(a, b &string) int {
|
|
||||||
if a.lt(b) {
|
if a.lt(b) {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
|
@ -911,9 +911,8 @@ pub fn (mut c Checker) call_fn(mut call_expr ast.CallExpr) table.Type {
|
||||||
call_expr.pos)
|
call_expr.pos)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !f.is_pub && f.language == .v && !c.is_builtin_mod && !c.pref.is_test && f.mod != c.mod &&
|
if !f.is_pub && f.language == .v && f.name.len > 0 && f.mod.len > 0 && f.mod != c.mod {
|
||||||
f.name != '' && f.mod != '' {
|
c.error('function `$f.name` is private. curmod=$c.mod fmod=$f.mod', call_expr.pos)
|
||||||
c.warn('function `$f.name` is private. curmod=$c.mod fmod=$f.mod', call_expr.pos)
|
|
||||||
}
|
}
|
||||||
call_expr.return_type = f.return_type
|
call_expr.return_type = f.return_type
|
||||||
if f.return_type == table.void_type && f.ctdefine.len > 0 && f.ctdefine !in c.pref.compile_defines {
|
if f.return_type == table.void_type && f.ctdefine.len > 0 && f.ctdefine !in c.pref.compile_defines {
|
||||||
|
|
|
@ -174,7 +174,7 @@ pub fn color_compare_files(diff_cmd, file1, file2 string) string {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
fn color_compare_strings(diff_cmd string, expected string, found string) string {
|
pub fn color_compare_strings(diff_cmd string, expected string, found string) string {
|
||||||
cdir := os.cache_dir()
|
cdir := os.cache_dir()
|
||||||
ctime := time.sys_mono_now()
|
ctime := time.sys_mono_now()
|
||||||
e_file := os.join_path(cdir, '${ctime}.expected.txt')
|
e_file := os.join_path(cdir, '${ctime}.expected.txt')
|
||||||
|
|
Loading…
Reference in New Issue