Why cannot Scala optimize the following:
a.
implicit def whatever[A](a: A) = new { ... }
to:
b.
class some$generated$name(a: A) {
...
}
implicit def whatever[A](a: A) = new some$generated$name(a)
?
Why does it have to use structural typing in this case? I would like Scala compiler to perform this optimization as writing in style b is just too ugly (because, 1. locality of logic is lost, 2. you have to unnecessarily invent names for these additional explicit classes), and a is far less performant than b.