Commit 9979719a9d

Noam Preil <noam@pixelhero.dev>
2020-09-08 20:10:17
Stage2 peer type resolution: comptime_int + other_int_type
1 parent ce29fc0
Changed files (1)
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 });
     }