is transformed to something like
object Test {
val tuple = Predef.ArrowAssoc.->(Predef.ArrowAssoc("aaa"), "bbb")
}
and the conversion Predef.ArrowAssoc is defined like this:
def ArrowAssoc[A](a: A): A = a
So no new instances are created. All that happens is a method call to -> on a singleton object and a method call to an identity function.
I agree that that extra method call could be avoided, but I think it's an artifact of how implicit conversions and value classes are compiled in different stages. And it will probably be optimized away at runtime anyway.
Kind regards,
Jasper
Op dinsdag 7 maart 2017 17:52:22 UTC+1 schreef Ryan Williams: