From b0c710c985c65ba22bbbd12358bfc46ea8cbbbd5 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 30 Apr 2020 18:51:29 +0200 Subject: [PATCH] checker: allow `fn == 0` comparison for now --- vlib/v/table/table.v | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vlib/v/table/table.v b/vlib/v/table/table.v index 5bf867deeb..1d0f9d32e9 100644 --- a/vlib/v/table/table.v +++ b/vlib/v/table/table.v @@ -497,6 +497,11 @@ pub fn (t &Table) check(got, expected Type) bool { // println(info.gen_types) return true } + if exp_type_sym.kind == .function && got_type_sym.kind == .int { + // TODO temporary + // fn == 0 + return true + } // allow enum value to be used as int if (got_type_sym.is_int() && exp_type_sym.kind == .enum_) || (exp_type_sym.is_int() && got_type_sym.kind == .enum_) {