handle multi-declarations in "show expression type"

This commit is contained in:
Dmitry Jemerov
2016-08-25 20:58:07 +02:00
parent fbd2c48fbd
commit 032d50bbbf
6 changed files with 67 additions and 4 deletions
@@ -0,0 +1,7 @@
data class IntStringPair(val x: Int, val s: String)
fun f(x: IntStringPair) {
val (fir<caret>st, second) = x
}
// TYPE: first -> <html>kotlin.Int</html>
@@ -0,0 +1,10 @@
data class IntStringPair(val x: Int, val s: String)
fun f(x: List<IntStringPair>) {
x.forEach { (fir<caret>st, second) ->
}
}
// TYPE: first -> <html>Int</html>
// TYPE: { (first, second) -> } -> <html>(IntStringPair) &rarr; Unit</html>
// TYPE: x.forEach { (first, second) -> } -> <html>Unit</html>
@@ -0,0 +1,8 @@
data class IntStringPair(val x: Int, val s: String)
fun f(x: List<IntStringPair>) {
for ((fir<caret>st, second) in x) {
}
}
// TYPE: first -> <html>Int</html>