mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: allow "u64_var == 0" without casting the const literal
This commit is contained in:
@ -610,6 +610,13 @@ fn (p mut Parser) _check_types(got_, expected_ string, throw bool) bool {
|
||||
if expected=='void*' && got=='int' {
|
||||
return true
|
||||
}
|
||||
// Allow `myu64 == 1`
|
||||
//if p.fileis('_test') && is_number_type(got) && is_number_type(expected) {
|
||||
//p.warn('got=$got exp=$expected $p.is_const_literal')
|
||||
//}
|
||||
if is_number_type(got) && is_number_type(expected) && p.is_const_literal {
|
||||
return true
|
||||
}
|
||||
expected = expected.replace('*', '')
|
||||
got = got.replace('*', '')
|
||||
if got != expected {
|
||||
|
Reference in New Issue
Block a user