8df759b05c
The main issue is that we have CombinedModuleInfo in old IDE Resolve, which essentially merges platfor-modules together with its dependsOn-parents. It conceals real module structure, which is fine for practically all clients except for ExpectedActualDeclarationChecker. In particular, it is nearly impossible to check expect/actual via ModuleDescriptors, because you'll always get one and the same 'merged'-module descriptor. So, this commit rewrites IdeaModuleStructureOracle in the following way: - use ModuleInfos instead of ModuleDescriptor, as they allow more fine-grained way to work with modules - use 'unwrapModuleSourceInfo' in seemingly random places in order to get real, non-merged moduleInfos - carefully convert them back to ModuleDescriptors, because EADC work with descriptors This is still not an ideal solution. In particular, last step is flawed: conversion back to ModuleDescriptors will always return merged moduleDescriptor for platform-modules. There's no easy way to fix that except for removing CombinedModuleInfo altogether, so we leave it as known issue. Also, there are some weird changes in testdata (again, because sometimes we see several modules merged together), but they are mostly confusing rather than plain incorrect.
16 lines
444 B
Kotlin
Vendored
16 lines
444 B
Kotlin
Vendored
package sample
|
|
|
|
actual class <!PACKAGE_OR_CLASSIFIER_REDECLARATION("A")!>A<!> {
|
|
actual fun foo(): Int = 45
|
|
fun fromBottom(): Int = 0
|
|
}
|
|
|
|
fun main() {
|
|
A().foo()
|
|
|
|
// Any behaviour is acceptable, as the code is erroneous.
|
|
// At the time of writing this test, we resolve to nearest A, i.e.
|
|
// 'fromBottom' is resolved, and 'fromLeft' is not.
|
|
A().fromLeft()
|
|
A().<!UNRESOLVED_REFERENCE("fromBottom")!>fromBottom<!>()
|
|
} |