Open scabug opened 7 years ago
Imported From: https://issues.scala-lang.org/browse/SI-10221?orig=1 Reporter: Matt Snelling (mzsnelling) Affected Versions: 2.12.1
https://github.com/scala/bug/issues/12008 duplicates this, but it adds a reason for using a type parameter: including Singleton
:
class V[I <: Int with Singleton](val i: I) extends AnyVal
val i = new V[1](1)
def accept[I <: Int with Singleton](i: V[I]): I = i.i
Attempting to run this code in the Repl:
Results in: