diff options
| author | joachimschmidt557 <joachim.schmidt557@outlook.com> | 2021-06-15 22:56:06 +0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-06-15 17:14:09 -0400 |
| commit | 76584ad0c6ac09e38da1abf354f86e3e3ecce659 (patch) | |
| tree | 0f935d5d3348de213d587bf22858b1fa10ca8a9c /src/Sema.zig | |
| parent | 90c73d8768bd51c84a5bf3d589d31abce6d93d37 (diff) | |
| download | zig-76584ad0c6ac09e38da1abf354f86e3e3ecce659.tar.gz zig-76584ad0c6ac09e38da1abf354f86e3e3ecce659.zip | |
stage2 Sema: add type resolving from comptime_float to float
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 07c8c3fc26..68d47b7f3b 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -7368,6 +7368,15 @@ fn resolvePeerTypes(sema: *Sema, block: *Scope.Block, src: LazySrcLoc, instructi continue; } + if (chosen.ty.zigTypeTag() == .ComptimeFloat and candidate.ty.isFloat()) { + chosen = candidate; + continue; + } + + if (chosen.ty.isFloat() and candidate.ty.zigTypeTag() == .ComptimeFloat) { + continue; + } + if (chosen.ty.zigTypeTag() == .Enum and candidate.ty.zigTypeTag() == .EnumLiteral) { continue; } |
