// "Create member function 'A.foo'" "true" class A(val n: T) { fun foo(i: Int, s: String): A = throw Exception() fun foo(i: T): A { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } } fun test() { val a: A = A(1).foo(2) }