checker: check `none` properly

pull/4732/head
Alexander Medvednikov 2020-05-05 15:29:52 +02:00
parent a0ca68ce3f
commit 7e71799980
1 changed files with 1 additions and 2 deletions

View File

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