trait G { fun foo(t : T) : T } class GC() : G { override fun foo(t: T): T { throw UnsupportedOperationException() } }