I think Mauro is spot on with the suggestion about traits.
I guess what you’re trying to do here is emulate a missing language feature: the ability to dispatch on which abstract interface a given type satisfies. I don’t have a solution for you, but you might find the following extended discussion interesting: