Create from usage: Do not generate function body if it's declared as a trait member

#KT-6078 Fixed
This commit is contained in:
Alexey Sedunov
2015-02-18 14:16:01 +03:00
parent 60d02dab0f
commit 0ae69e0d3e
6 changed files with 56 additions and 3 deletions
@@ -0,0 +1,11 @@
// "Create extension function 'foo'" "true"
trait T
fun test(t: T) {
val b: Boolean = t.foo("1", 2)
}
fun T.foo(s: String, i: Int): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -0,0 +1,9 @@
// "Create function 'foo'" "true"
trait T {
fun foo(s: String, i: Int): Boolean
}
fun test(t: T) {
val b: Boolean = t.foo("1", 2)
}
@@ -0,0 +1,7 @@
// "Create extension function 'foo'" "true"
trait T
fun test(t: T) {
val b: Boolean = t.<caret>foo("1", 2)
}
@@ -0,0 +1,7 @@
// "Create function 'foo'" "true"
trait T
fun test(t: T) {
val b: Boolean = t.<caret>foo("1", 2)
}