scala-dev
scala-dev copied to clipboard
Remove JFunctionN$sp.. classes
A follow-up for https://github.com/scala/scala/pull/5298 / https://github.com/scala/scala-dev/issues/121
Maybe one day we can remove the hand-specialized JFunctionN$sp..
classes by adjusting specialization to leave the specialized method abstract, instead of the generic one.
trait A[@specialized(Int) T] {
def apply(x: T): Int
}
currently produces
trait A {
def apply(x: Object): Object
def apply$mcI$sp(x: Int): String = apply(box(x))
}
If we let LMF synthesize an implementation of A
, it will implement the generic method, so every invocation of the lambda will box the argument.