From fc5f4ff32675068d1574b15343a299535e43e36c Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Fri, 27 Dec 2019 10:12:40 +0100 Subject: [PATCH] make types.check public --- vlib/compiler/compile_errors.v | 4 +++- vlib/v/types/types.v | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/vlib/compiler/compile_errors.v b/vlib/compiler/compile_errors.v index 2628d40d31..e80154971e 100644 --- a/vlib/compiler/compile_errors.v +++ b/vlib/compiler/compile_errors.v @@ -191,7 +191,9 @@ fn (p mut Parser) print_error_context() { fn normalized_error(s string) string { // Print `[]int` instead of `array_int` in errors - mut res := s.replace('array_', '[]').replace('__', '.').replace('Option_', '?').replace('main.', '').replace('ptr_', '&') + mut res := s.replace('array_', '[]').replace('__', '.') + .replace('Option_', '?').replace('main.', '').replace('ptr_', '&') + .replace('_dot_', '.') if res.contains('_V_MulRet_') { res = res.replace('_V_MulRet_', '(').replace('_V_', ', ') res = res[..res.len - 1] + ')"' diff --git a/vlib/v/types/types.v b/vlib/v/types/types.v index 81066ab7a7..15f1d00d32 100644 --- a/vlib/v/types/types.v +++ b/vlib/v/types/types.v @@ -16,7 +16,7 @@ pub const ( ) -fn check(got, expected &Type) bool { +pub fn check(got, expected &Type) bool { if got.idx != expected.idx { return false }