Fix peer type resolution
This commit is contained in:
@@ -2661,11 +2661,15 @@ pub fn resolvePeerTypes(self: *Module, scope: *Scope, instructions: []*Inst) !Ty
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((prev_inst.ty.zigTypeTag() == .ComptimeInt and next_inst.ty.isInt()) or (next_inst.ty.zigTypeTag() == .ComptimeInt and prev_inst.ty.isInt())) {
|
||||
if (prev_inst.ty.zigTypeTag() == .ComptimeInt and next_inst.ty.isInt()) {
|
||||
prev_inst = next_inst;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (prev_inst.ty.isInt() and next_inst.ty.zigTypeTag() == .ComptimeInt) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO error notes pointing out each type
|
||||
return self.fail(scope, next_inst.src, "incompatible types: '{}' and '{}'", .{ prev_inst.ty, next_inst.ty });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user