Refine predicate for 'iter' postfix template

Use IterableTypesDetection to determine if the given expression may be iterated

 #KT-14134 Fixed
 #KT-14129 Fixed
This commit is contained in:
Denis Zharkov
2017-03-10 18:13:13 +03:00
parent 465a424af4
commit bd88919411
7 changed files with 44 additions and 11 deletions
+3
View File
@@ -0,0 +1,3 @@
fun foo(map: Map<String, Int>) {
map.for<caret>
}
+5
View File
@@ -0,0 +1,5 @@
fun foo(map: Map<String, Int>) {
for (entry in map) {
<caret>
}
}
+3
View File
@@ -0,0 +1,3 @@
fun foo(list: List<String>) {
list[0].for<caret>
}
@@ -0,0 +1,5 @@
fun foo(list: List<String>) {
for (c in list[0]) {
<caret>
}
}