Question: I was wondering if there as a way to know if an object is an instance of a case class. I was trying to find some structural type matching `unapply`, I notice they inherit `Product`. My real need for a function that would go something like:

```
def withCaseClass[T <: /* matcher for case class */](obj:T) ...

```

My major interest is to make sure only case classes can be passed to this function.

Answer: 
There's no marker trait for either case classes or tuples, so I'm afraid your best bet might be to check that it extends Product and isn't in any package starting with "scala.\*". :/
In Java I've used

```
Product.class.isAssignableFrom(someClassThatMayBeACaseClass);

```

to detect if something is a case class. Though it's likely there are Products that are not case classes.