If I have some class heirarchy defined like this
sealed trait A
case class B() extends A
case class C() extends A
// and so on ..
and in a different location I want to call some method dynamically passing above classes as type to that function
(eg: method[B](..){..} or method[C](..){..}
)
How can this be achieved at runtime?