Peer type resolution: comptime_int decay to other int

This commit is contained in:
Noam Preil 2020-09-14 19:44:32 -04:00
parent ea7b2750c8
commit a2e1639d6d
No known key found for this signature in database
GPG Key ID: FC347E7C85BE8238

View File

@ -2661,7 +2661,7 @@ pub fn resolvePeerTypes(self: *Module, scope: *Scope, instructions: []*Inst) !Ty
continue;
}
if (prev_inst.ty.zigTypeTag() == .ComptimeInt and next_inst.ty.isInt()) {
if ((prev_inst.ty.zigTypeTag() == .ComptimeInt and next_inst.ty.isInt()) or (next_inst.ty.zigTypeTag() == .ComptimeInt and prev_inst.ty.isInt())) {
prev_inst = next_inst;
continue;
}