i gave a quick shot at trying to make a solution based on reflection, but that doesn’t work.
import scala.language.reflectiveCalls
def add[T <: { def +(other: T): T }: Manifest](a: T, b: T): T =
a + b
println(add(5, 6))
println(add(2f, 3f))
that doesn’t work and quick googling points to this answer why: Structural types: Structural access not allowed … because it has a parameter type with an unstable erasure - #3 by Odersky
i’ve tried to make metaprogramming based alternative, but i’m still too weak in that regard