Strange behavior when using -release 8 scalac option
Jasper-M opened this issue · comments
Jasper Moeys commented
scalaVersion := "2.13.8"
libraryDependencies += "com.chuusai" %% "shapeless" % "2.3.8"
scalacOptions ++= List("-release", "8")
Welcome to Scala 2.13.8 (OpenJDK 64-Bit Server VM, Java 11.0.14).
Type in expressions for evaluation. Or try :help.
scala> shapeless.LabelledGeneric[java.time.Instant]
val res0: shapeless.LabelledGeneric[java.time.Instant]{type Repr = shapeless.HNil} = shapeless.LabelledGeneric$$anon$2@6f3ac7af
Shapeless seems to treat java.time.Instant
as a nullary case class now.
The culprit is probably the compiler, but filing it here too since shapeless and downstream libraries are affected.
Jasper Moeys commented
Compiler ticket and likely cause of this issue: scala/bug#12565
My theory is that the fake constructor causes shapeless to think that Instant
is "case class like".
Georgi Krastev commented
wow 😮
Georgi Krastev commented
Since the bug was confirmed in Scala and already has PR I think we can close it here