-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:typeritype:bugregressionThis worked in a previous version but doesn't anymoreThis worked in a previous version but doesn't anymore
Milestone
Description
Compiler version
3.2.0-RC1-bin-20220429-400427d-NIGHTLY
Works with 3.1.2
The first bad commit is 54dc0c1 from #14761
Minimized code
//> using scala "3.2.0-RC1-bin-20220429-400427d-NIGHTLY"
// Last working version
// //> using scala "3.1.2"
import scala.reflect.ClassTag
// https://github.com/json4s/json4s/blob/355d8751391773e0d79d04402a4f9fb7bfc684ec/ext/src/main/scala-3/org/json4s/ext/package.scala#L4-L8
type Aux[A] = { type Value = A }
type EnumValue[A <: Enumeration] = A match {
case Aux[a] => a
}
// https://github.com/json4s/json4s/blob/355d8751391773e0d79d04402a4f9fb7bfc684ec/ext/src/main/scala/org/json4s/ext/EnumSerializer.scala#L25-L26
class EnumSerializer[E <: Enumeration: ClassTag](enumeration: E) {
val EnumerationClass = classOf[EnumValue[E]]
}
Output
[error] ./test.scala:15:34: EnumValue[E] is not a class type
[error] val EnumerationClass = classOf[EnumValue[E]]
[error] ^^^^^^^^^^^^```
Expectation
Should correctly allow getting an instance of Class for Enum.Value
Metadata
Metadata
Assignees
Labels
area:typeritype:bugregressionThis worked in a previous version but doesn't anymoreThis worked in a previous version but doesn't anymore