open class Outer { class Nested : Outer() { fun bar(): U = foo() fun baz(): U = super.foo() } class Nested2 : Outer() { fun bar(): String = foo() fun baz(): String = super.foo() } fun foo(): T = null!! }