From 7e71799980f3dea8d3f7ea688f3f591d5faf5829 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Tue, 5 May 2020 15:29:52 +0200 Subject: [PATCH] checker: check `none` properly --- vlib/v/table/table.v | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vlib/v/table/table.v b/vlib/v/table/table.v index a3a0d1cc72..f2685a6b09 100644 --- a/vlib/v/table/table.v +++ b/vlib/v/table/table.v @@ -440,8 +440,7 @@ pub fn (t &Table) check(got, expected Type) bool { // and the other is not, is this correct behaviour? return true } - if got_idx == none_type_idx { - // TODO + if got_idx == none_type_idx && expected.flag_is(.optional) { return true } // allow pointers to be initialized with 0. TODO: use none instead