Open
Description
Scala 2.13.12
Example:
class Key[T] {}
object example {
private val Key: Key[java.lang.Boolean.TRUE.type] = new Key[java.lang.Boolean.TRUE.type]
def putUserData[T](key: Key[T], value: T): Unit = ???
def main(args: Array[String]): Unit = {
//OK: compiles fine
val value: java.lang.Boolean.TRUE.type = java.lang.Boolean.TRUE
val option: Option[java.lang.Boolean.TRUE.type] = Option(java.lang.Boolean.TRUE)
//Error: found: Boolean, required: Boolean.TRUE.type
putUserData(Key, java.lang.Boolean.TRUE)
}
}
The code compiles with error at line 14
type mismatch;
found : Boolean
required: Boolean.TRUE.type
putUserData(Key, java.lang.Boolean.TRUE)
Note that it compiles fine in Scala 3.3.1