I would like to generate functions for a class accepting 1 type parameter
case class C[T] (t: T)
depending on the T
type parameter.
The functions I would like to generate are derived by the functions available on T
.
What I would like exactly, is to make all the functions available for T
, also available for C
.
As an example for C[Int]
, I would like to be able to call on C
any function available on Int
and dispatch the function call to the Int
contained in C
.
val c1 = new C(1)
assert(c1 + 1 == 2)
How can I achieve this by using Scala 2 or dotty macros? Or, can this be achieved in another way?