table: fix float/integer cast bug

pull/2695/head
Alexander Medvednikov 2019-11-08 02:04:00 +03:00
parent f579376638
commit 27f6b2dd73
1 changed files with 2 additions and 2 deletions

View File

@ -671,11 +671,11 @@ fn (p mut Parser) check_types2(got_, expected_ string, throw bool) bool {
if expected=='void*' && got=='int' { if expected=='void*' && got=='int' {
return true return true
} }
// Allow `myu64 == 1`
//if p.fileis('_test') && is_number_type(got) && is_number_type(expected) { //if p.fileis('_test') && is_number_type(got) && is_number_type(expected) {
//p.warn('got=$got exp=$expected $p.is_const_literal') //p.warn('got=$got exp=$expected $p.is_const_literal')
//} //}
if is_number_type(got) && is_number_type(expected) && p.is_const_literal { // Allow `myu64 == 1`, `myfloat == 2` etc
if is_integer_type(got) && is_number_type(expected) && p.is_const_literal {
return true return true
} }