From 4a556f72bb7360c7a56c8e74cfff1e366e957f0d Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Fri, 17 Apr 2020 17:18:40 +0200 Subject: [PATCH] checker: allow calling private functions in tests --- vlib/v/checker/checker.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index e7e5296233..168ebd938c 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -322,7 +322,7 @@ pub fn (c mut Checker) call_method(call_expr mut ast.CallExpr) table.Type { return info.elem_type } if method := c.table.type_find_method(left_type_sym, method_name) { - if !method.is_pub && !c.is_builtin_mod && left_type_sym.mod != c.mod && left_type_sym.mod != '' { // method.mod != c.mod { + if !method.is_pub && !c.is_builtin_mod && !c.pref.is_test && left_type_sym.mod != c.mod && left_type_sym.mod != '' { // method.mod != c.mod { // If a private method is called outside of the module // its receiver type is defined in, show an error. //println('warn $method_name lef.mod=$left_type_sym.mod c.mod=$c.mod')