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