Convert lambda to reference: flexible receiver types are handled correctly #KT-13411 Fixed

(cherry picked from commit ecad1c3)
This commit is contained in:
Mikhail Glukhikh
2016-08-31 14:39:13 +03:00
committed by Mikhail Glukhikh
parent 863e4afc7b
commit a41c4b9a0f
10 changed files with 62 additions and 2 deletions
@@ -0,0 +1,5 @@
import java.util.List;
class B {
public static List<Object> text;
}
@@ -0,0 +1,5 @@
import java.util.List;
class B {
public static List<Object> text;
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
// See KT-13411
fun use() {
B.text.map { <caret>it.toString() }
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
// See KT-13411
fun use() {
B.text.map(Any?::toString)
}
@@ -0,0 +1,5 @@
import java.util.List;
class B {
public static List<List<Object>> text;
}
@@ -0,0 +1,5 @@
import java.util.List;
class B {
public static List<List<Object>> text;
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
// See KT-13411
fun use() {
val text = B.text
text.map { <caret>it.toString() }
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
// See KT-13411
fun use() {
val text = B.text
text.map(MutableList<Any>?::toString)
}