Commit 76584ad0c6

joachimschmidt557 <joachim.schmidt557@outlook.com>
2021-06-15 16:56:06
stage2 Sema: add type resolving from comptime_float to float
1 parent 90c73d8
Changed files (1)
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;
         }