fb14b03824
Currently, FIR reports errors caused by previous resolution failure. For example with unresolved `a` and `b` in code `a.b`, both `a` and `b` are highlighted. FE1.0 only highlights `a` since it's the root cause. This change applies this heuristics when reporting FirDiagnostics.
54 lines
1.9 KiB
Kotlin
Vendored
54 lines
1.9 KiB
Kotlin
Vendored
interface N { fun foo() = 1 }
|
|
|
|
class WithClassObject {
|
|
companion object {}
|
|
|
|
class Nested()
|
|
class NestedWithClassObject { companion object : N }
|
|
enum class NestedEnum { A }
|
|
object NestedObj : N { operator fun invoke() = 1 }
|
|
}
|
|
|
|
class WithoutClassObject {
|
|
class Nested()
|
|
class NestedWithClassObject { companion object : N }
|
|
enum class NestedEnum { A }
|
|
object NestedObj : N { operator fun invoke() = 1 }
|
|
}
|
|
|
|
object Obj {
|
|
class Nested()
|
|
class NestedWithClassObject { companion object : N }
|
|
enum class NestedEnum { A }
|
|
object NestedObj : N { operator fun invoke() = 1 }
|
|
}
|
|
|
|
fun test(with: WithClassObject, without: WithoutClassObject, obj: Obj) {
|
|
with.<!UNRESOLVED_REFERENCE!>Nested<!>()
|
|
with.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>
|
|
with.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>()
|
|
with.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>.foo()
|
|
with.<!UNRESOLVED_REFERENCE!>NestedEnum<!>.A
|
|
with.<!UNRESOLVED_REFERENCE!>NestedObj<!>
|
|
with.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
|
|
with.<!UNRESOLVED_REFERENCE!>NestedObj<!>.foo()
|
|
|
|
without.<!UNRESOLVED_REFERENCE!>Nested<!>()
|
|
without.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>
|
|
without.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>()
|
|
without.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>.foo()
|
|
without.<!UNRESOLVED_REFERENCE!>NestedEnum<!>.A
|
|
without.<!UNRESOLVED_REFERENCE!>NestedObj<!>
|
|
without.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
|
|
without.<!UNRESOLVED_REFERENCE!>NestedObj<!>.foo()
|
|
|
|
obj.<!UNRESOLVED_REFERENCE!>Nested<!>()
|
|
obj.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>
|
|
obj.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>()
|
|
obj.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>.foo()
|
|
obj.<!UNRESOLVED_REFERENCE!>NestedEnum<!>.A
|
|
obj.<!UNRESOLVED_REFERENCE!>NestedObj<!>
|
|
obj.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
|
|
obj.<!UNRESOLVED_REFERENCE!>NestedObj<!>.foo()
|
|
}
|