Create from Usage: Strip first parameter of extension function when expected type is non-extension
This commit is contained in:
+9
@@ -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))
|
||||
}
|
||||
+13
@@ -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>
|
||||
}
|
||||
Reference in New Issue
Block a user