860dee2cb1
FirReferenceResolveHelper internally checks whether the referenced class
id matches the qualifed access or not. If they do not match, it reports
an error. When the companion object has the same name as the class,
resolving a qualified expression access to a member of the companion
object causes an error because of the mismatch e.g.,
```
package my.sample
class Test {
fun a() {
my.sample.<caret>Test.say()
}
companion object Test {
fun say() {}
}
}
```
This commit fixes the issue.
TODO: When the companion object has a name difference from class, it
does not report an error but the resolution result is wrong in FIR. See
KT-56167.
---
Commentary from rebaser: the issue mentioned in this code is
fixed in 71a368e06e, so the actual
fix is omitted, and only test data is preserved
12 lines
149 B
Kotlin
Vendored
12 lines
149 B
Kotlin
Vendored
package my.sample
|
|
|
|
class Inner {
|
|
fun a() {
|
|
my.sample.<caret>Inner.say()
|
|
}
|
|
|
|
companion object Inner {
|
|
fun say() {}
|
|
}
|
|
}
|