diff options
| author | Noam Preil <noam@pixelhero.dev> | 2020-10-07 02:31:47 -0400 |
|---|---|---|
| committer | Noam Preil <noam@pixelhero.dev> | 2020-10-07 02:31:47 -0400 |
| commit | de093879ccc46263c3c6a87173bcf5089d48b4b7 (patch) | |
| tree | 441cb297be500d37c6660bb3149e83426f808ffb /src | |
| parent | 7b88215a49b2e394508bb8014649747527a4edf6 (diff) | |
| download | zig-de093879ccc46263c3c6a87173bcf5089d48b4b7.tar.gz zig-de093879ccc46263c3c6a87173bcf5089d48b4b7.zip | |
Fix peer type resolution
Diffstat (limited to 'src')
| -rw-r--r-- | src/Module.zig | 6 |
1 files changed, 5 insertions, 1 deletions
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 }); } |
