Introduce FirForLoopChecker

This commit is contained in:
Mikhail Glukhikh
2021-04-02 13:19:04 +03:00
parent 4ddc0ed3fe
commit 2e14b65644
35 changed files with 708 additions and 118 deletions
@@ -1,27 +0,0 @@
//KT-1821 Write test for ITERATOR_AMBIGUITY diagnostic
interface MyCollectionInterface {
}
interface MyAnotherCollectionInterface {
}
class MyCollection : MyCollectionInterface, MyAnotherCollectionInterface {
}
fun MyCollectionInterface.iterator() = MyIterator()
fun MyAnotherCollectionInterface.iterator() = MyIterator()
class MyIterator {
fun next() : MyElement = MyElement()
fun hasNext() = true
}
class MyElement
fun test1(collection: MyCollection) {
collection.<!OVERLOAD_RESOLUTION_AMBIGUITY!>iterator<!>()
<!OVERLOAD_RESOLUTION_AMBIGUITY, UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>for (element in collection) {
}<!>
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
//KT-1821 Write test for ITERATOR_AMBIGUITY diagnostic
interface MyCollectionInterface {