From 9979719a9d0902ffde692ef06e7facf4c1921b99 Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Tue, 8 Sep 2020 14:10:17 -0400 Subject: Stage2 peer type resolution: comptime_int + other_int_type --- src/Module.zig | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Module.zig') diff --git a/src/Module.zig b/src/Module.zig index 75b6afffcd..151f507ef4 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -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 }); } -- cgit v1.2.3