Ambiguous type, obviously none. The caller needs to know what they'll get, so it's isn't possible. All any language can return is either base type, interface or dynamic type (and dynamic type is basically just type with by-name call, get and set methods). So I'll assume you simply want it to return an interface `IXY` that derives `IX` *and* `IY` though that interface was not declared in either `A` or `B`, possibly because wasn't declared when those types were defined. In that case:

 * Any that is dynamically typed, obviously.
 * [GO](http://golang.org/), because it's classes implement interface if they have the correct methods, without ever declaring them. So you just declare an interface that derives the two there and return it.
 * You can do the same in [Haskell](http://www.haskell.org) where interfaces (they are called classes there) can be defined for existing types, so again you declare interface deriving the two and return it.
 * Obviously any other language where type can be defined to implement interface outside of definition of that type.
 * It's not possible in any type where implementing an interface has to be defined in the type definition itself. You can however work around in most of them by defining wrapper that implements the two interfaces and delegates all methods to a wrapped object.