From 74dbb1bce34301b326c799f6eacfa235095e1470 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 4 Jul 2019 23:28:39 +0200 Subject: [PATCH] interface: fix function is private bug --- compiler/fn.v | 2 +- vlib/builtin/array.v | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/fn.v b/compiler/fn.v index a7df439f76..7e761640f2 100644 --- a/compiler/fn.v +++ b/compiler/fn.v @@ -503,7 +503,7 @@ fn (p mut Parser) async_fn_call(f Fn, method_ph int, receiver_var, receiver_type } fn (p mut Parser) fn_call(f Fn, method_ph int, receiver_var, receiver_type string) { - if !f.is_public && !f.is_c && !p.pref.is_test && f.pkg != p.pkg { + if !f.is_public && !f.is_c && !p.pref.is_test && !f.is_interface && f.pkg != p.pkg { p.error('function `$f.name` is private') } p.calling_c = f.is_c diff --git a/vlib/builtin/array.v b/vlib/builtin/array.v index cec68385e6..0b9e1e999d 100644 --- a/vlib/builtin/array.v +++ b/vlib/builtin/array.v @@ -172,6 +172,7 @@ fn (arr mut array) _push(val voidptr) { } // `val` is array.data +// TODO make private, right now it's used by strings.Builder pub fn (arr mut array) _push_many(val voidptr, size int) { if arr.len >= arr.cap - size { cap := (arr.len + size) * 2