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

table: fix check for fn with no args

This commit is contained in:
joe-conigliaro 2020-05-05 02:44:10 +10:00
parent 2bb995274e
commit c9798d3918
No known key found for this signature in database
GPG Key ID: C12F7136C08206F1

View File

@ -535,15 +535,13 @@ pub fn (t &Table) check(got, expected Type) bool {
got_info := got_type_sym.info as FnType
exp_info := exp_type_sym.info as FnType
if got_info.func.args.len == exp_info.func.args.len {
mut matching := false
for i, got_arg in got_info.func.args {
exp_arg := exp_info.func.args[i]
matching = t.check(got_arg.typ, exp_arg.typ)
if !matching {
if !t.check(got_arg.typ, exp_arg.typ) {
return false
}
}
return matching
return true
}
}
return false