I am writing my own simple javax.sql.DataSource implementation, the only method of it I need to work is getConnection: Connection, but the interfac
The "correct" solution is to do something which will immediately fail. Like so:
def unwrap[T](iface: Class[T]): T = sys.error("unimplemented")
In scala 2.10, this would have been implemented as:
def unwrap[T](iface: Class[T]): T = ???
Because there is a new method in Predef called ???. This works because an expression of the form throw new Exception has the type Nothing, which is a subtype of any type (it is called bottom in type-theoretical circles).
The reason that this is correct is that it is much better to fail instantly with an error, rather than use a null which may fail later and obfuscate the cause.