Stage2 peer type resolution: comptime_int + other_int_type

This commit is contained in:
Noam Preil 2020-09-08 14:10:17 -04:00
parent ce29fc0947
commit 9979719a9d
No known key found for this signature in database
GPG Key ID: FC347E7C85BE8238

View File

@ -2661,6 +2661,11 @@ pub fn resolvePeerTypes(self: *Module, scope: *Scope, instructions: []*Inst) !Ty
continue;
}
if (prev_inst.ty.zigTypeTag() == .ComptimeInt and next_inst.ty.isInt()) {
prev_inst = next_inst;
continue;
}
// TODO error notes pointing out each type
return self.fail(scope, next_inst.src, "incompatible types: '{}' and '{}'", .{ prev_inst.ty, next_inst.ty });
}