make types.check public

pull/3229/head
Alexander Medvednikov 2019-12-27 10:12:40 +01:00
parent d27c5eb345
commit fc5f4ff326
2 changed files with 4 additions and 2 deletions

View File

@ -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] + ')"'

View File

@ -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
}