I was wondering if there is a way to find out if an object is an instance of the case class. I tried to find some structural type corresponding unapply, I noticed that they inherit Product. My real need is for a function that will look something like this:
def withCaseClass[T <: /* matcher for case class */](obj:T) ...
My main interest is to make sure that only case classes can be passed to this function.
source
share