1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

temporary nil fn check

This commit is contained in:
Alexander Medvednikov
2020-01-14 13:15:04 +01:00
parent 25e7ceeef0
commit 0b235cc893
2 changed files with 7 additions and 0 deletions

View File

@ -621,6 +621,10 @@ fn (p mut Parser) check_types2(got_, expected_ string, throw bool) bool {
if got.starts_with('varg_') {
got = got[5..]
}
// fn == 0 temporary
if got == 'int' && expected.ends_with('Fn') {
return true
}
// Allow ints to be used as floats
if got == 'int' && expected == 'f32' {
return true