zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 9979719a9d0902ffde692ef06e7facf4c1921b99 (tree)
parent ce29fc09470f0db9e7bdc075ebb84fe42146a222
Author: Noam Preil <noam@pixelhero.dev>
Date:   Tue,  8 Sep 2020 14:10:17 -0400

Stage2 peer type resolution: comptime_int + other_int_type

Diffstat:
Msrc/Module.zig | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git 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 }); }