Skip to content

Commit bf6b17a

Browse files
committed
Bug compatibility with scala/bug/issues/11253
Scalac mistakingly uses Double precision when performing primitive binary operations on Long that take a Float argument. Once this bug is fixed upstream we can conditionally enable the workaround only on affected versions.
1 parent 99c6fbc commit bf6b17a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

nscplugin/src/main/scala/scala/scalanative/nscplugin/NirGenExpr.scala

+3
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,9 @@ trait NirGenExpr { self: NirGenPhase =>
985985
}
986986

987987
def binaryOperationType(lty: nir.Type, rty: nir.Type) = (lty, rty) match {
988+
// Bug compatibility with scala/bug/issues/11253
989+
case (Type.Long, Type.Float) =>
990+
Type.Double
988991
case (nir.Type.Ptr, _: nir.Type.RefKind) =>
989992
lty
990993
case (_: nir.Type.RefKind, nir.Type.Ptr) =>

0 commit comments

Comments
 (0)