Convert lambda to reference: range reduced to a call itself #KT-13661 Fixed

(cherry picked from commit f7b5d34)
This commit is contained in:
Mikhail Glukhikh
2016-08-31 13:11:21 +03:00
committed by Mikhail Glukhikh
parent a6e3aac7ca
commit ec41289664
3 changed files with 25 additions and 2 deletions
+7 -1
View File
@@ -6,4 +6,10 @@ val x = { y: Int -> TheirWrapper(y) }
// Should not suggest to convert (too long reference)
fun foo(arg: TheirWrapper, convert: (TheirWrapper) -> String) = convert(arg)
val y = foo(TheirWrapper(42)) { it.toString() }
val y = foo(TheirWrapper(42)) { it.toString() }
// Also should suggest to convert, but only call should be highlighted
fun bar(arg: Int, convert: (Int) -> TheirWrapper) = convert(arg)
val z = bar(42) {
TheirWrapper(it)
}