From de093879ccc46263c3c6a87173bcf5089d48b4b7 Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Wed, 7 Oct 2020 02:31:47 -0400 Subject: Fix peer type resolution --- src/Module.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Module.zig') diff --git a/src/Module.zig b/src/Module.zig index ba79407a80..b3bdefceec 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -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 }); } -- cgit v1.2.3