aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorNoam Preil <noam@pixelhero.dev>2020-09-08 14:10:17 -0400
committerNoam Preil <noam@pixelhero.dev>2020-10-06 15:09:56 -0400
commit9979719a9d0902ffde692ef06e7facf4c1921b99 (patch)
treefe4758a6a2209f65d1e72dd515062d134f3ce0b8 /src/Module.zig
parentce29fc09470f0db9e7bdc075ebb84fe42146a222 (diff)
downloadzig-9979719a9d0902ffde692ef06e7facf4c1921b99.tar.gz
zig-9979719a9d0902ffde692ef06e7facf4c1921b99.zip
Stage2 peer type resolution: comptime_int + other_int_type
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig5
1 files changed, 5 insertions, 0 deletions
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 });
}