Create from Usage: Strip first parameter of extension function when expected type is non-extension

This commit is contained in:
Alexey Sedunov
2015-12-22 12:59:39 +03:00
parent da2806acde
commit ee9389d089
4 changed files with 35 additions and 3 deletions
@@ -0,0 +1,9 @@
// "Create extension function 'foo'" "true"
// WITH_RUNTIME
fun <T, U> T.map(f: (T) -> U) = f(this)
fun consume(s: String) {}
fun test() {
consume(1.map(Int::<caret>foo))
}
@@ -0,0 +1,13 @@
// "Create extension function 'foo'" "true"
// WITH_RUNTIME
fun <T, U> T.map(f: (T) -> U) = f(this)
fun consume(s: String) {}
fun test() {
consume(1.map(Int::foo))
}
fun Int.foo(): String {
<selection>throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.</selection>
}