stage2 Sema: add type resolving from comptime_float to float

This commit is contained in:
joachimschmidt557 2021-06-15 22:56:06 +08:00 committed by Andrew Kelley
parent 90c73d8768
commit 76584ad0c6

View File

@ -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;
}