diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/impl/FirDependenciesSymbolProviderImpl.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/impl/FirDependenciesSymbolProviderImpl.kt index 9f1c4cf55cc..962d19163b2 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/impl/FirDependenciesSymbolProviderImpl.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/impl/FirDependenciesSymbolProviderImpl.kt @@ -17,11 +17,6 @@ import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.FqName class FirDependenciesSymbolProviderImpl(val session: FirSession) : AbstractFirSymbolProvider() { - override fun getCallableSymbols(callableId: CallableId): List { - // TODO - return emptyList() - } - private val dependencyProviders by lazy { val moduleInfo = session.moduleInfo ?: return@lazy emptyList() moduleInfo.dependenciesWithoutSelf().mapNotNull { @@ -29,6 +24,17 @@ class FirDependenciesSymbolProviderImpl(val session: FirSession) : AbstractFirSy }.toList() } + override fun getCallableSymbols(callableId: CallableId): List { + return callableCache.lookupCacheOrCalculate(callableId) { + for (provider in dependencyProviders) { + provider.getCallableSymbols(callableId).let { + if (it.isNotEmpty()) return@lookupCacheOrCalculate it + } + } + emptyList() + }.orEmpty() + } + override fun getClassLikeSymbolByFqName(classId: ClassId): ConeClassLikeSymbol? { return classCache.lookupCacheOrCalculate(classId) { for (provider in dependencyProviders) { diff --git a/compiler/fir/resolve/testData/enhancement/jsr305/NonNullNever.fir.txt b/compiler/fir/resolve/testData/enhancement/jsr305/NonNullNever.fir.txt index 27c1034a9f1..6bba2a99591 100644 --- a/compiler/fir/resolve/testData/enhancement/jsr305/NonNullNever.fir.txt +++ b/compiler/fir/resolve/testData/enhancement/jsr305/NonNullNever.fir.txt @@ -1,10 +1,10 @@ -@R|java/lang/annotation/Documented|() @R|javax/annotation/meta/TypeQualifierNickname|() @R|javax/annotation/Nonnull|(#()) @R|java/lang/annotation/Retention|(#()) public abstract annotation class MyNullable : R|java/lang/annotation/Annotation| { +@R|java/lang/annotation/Documented|() @R|javax/annotation/meta/TypeQualifierNickname|() @R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.NEVER|()) @R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) public abstract annotation class MyNullable : R|java/lang/annotation/Annotation| { } public open class NonNullNever : R|java/lang/Object| { - @R|javax/annotation/Nonnull|(#()) public open property field(var): R|ft| - public get(): R|ft| - public set(value: R|ft|): kotlin/Unit + @R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.NEVER|()) public open property field(var): R|ft|? + public get(): R|ft|? + public set(value: R|ft|?): kotlin/Unit - @R|MyNullable|() public open operator function foo(@R|javax/annotation/Nonnull|(#()) x: R|ft|, @R|MyNullable|() y: R|ft|): R|ft| + @R|MyNullable|() public open operator function foo(@R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.NEVER|()) x: R|ft|?, @R|MyNullable|() y: R|ft|?): R|ft|? } diff --git a/compiler/fir/resolve/testData/enhancement/jsr305/Strange.fir.txt b/compiler/fir/resolve/testData/enhancement/jsr305/Strange.fir.txt index 7a9d5106f22..b4c8bf093ee 100644 --- a/compiler/fir/resolve/testData/enhancement/jsr305/Strange.fir.txt +++ b/compiler/fir/resolve/testData/enhancement/jsr305/Strange.fir.txt @@ -1,9 +1,9 @@ public open class Strange : R|java/lang/Object| { - @R|javax/annotation/Nonnull|(#()) public open property field(var): R|ft| - public get(): R|ft| - public set(value: R|ft|): kotlin/Unit + @R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.UNKNOWN|()) public open property field(var): R|ft|! + public get(): R|ft|! + public set(value: R|ft|!): kotlin/Unit - @R|javax/annotation/Nonnull|(#()) public open operator function foo(@R|javax/annotation/Nonnull|(#()) x: R|ft|, @R|javax/annotation/Nonnull|(#()) y: R|ft|): R|ft| + @R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.MAYBE|()) public open operator function foo(@R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.ALWAYS|()) x: R|ft|, @R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.NEVER|()) y: R|ft|?): R|ft|? @R|javax/annotation/Nonnull|() public open operator function bar(): R|ft| diff --git a/compiler/testData/loadJava/compiledJava/static/StaticMembersInEnum.fir.txt b/compiler/testData/loadJava/compiledJava/static/StaticMembersInEnum.fir.txt index 9c70f2a51c1..4cc2add9046 100644 --- a/compiler/testData/loadJava/compiledJava/static/StaticMembersInEnum.fir.txt +++ b/compiler/testData/loadJava/compiledJava/static/StaticMembersInEnum.fir.txt @@ -15,4 +15,6 @@ public final enum class StaticMembersInEnum : R|java/lang/Enum: R|ft>, java/lang/Class>?>|!, : R|ft|!): R|ft|! + } diff --git a/idea/testData/fir/multiModule/mppFakeOverrides/jvm/jvm.txt b/idea/testData/fir/multiModule/mppFakeOverrides/jvm/jvm.txt index 567e60a7c9f..e2fa8e18717 100644 --- a/idea/testData/fir/multiModule/mppFakeOverrides/jvm/jvm.txt +++ b/idea/testData/fir/multiModule/mppFakeOverrides/jvm/jvm.txt @@ -15,7 +15,7 @@ FILE: jvm.kt public final function test(): R|kotlin/Unit| { R|FakeOverride|(String()) - R|FakeOverride|(String()) + #(String()) } } diff --git a/idea/testData/fir/multiModule/mppMemberType/jvm/jvm.txt b/idea/testData/fir/multiModule/mppMemberType/jvm/jvm.txt index e9a987049ba..3f5acf439d8 100644 --- a/idea/testData/fir/multiModule/mppMemberType/jvm/jvm.txt +++ b/idea/testData/fir/multiModule/mppMemberType/jvm/jvm.txt @@ -27,8 +27,8 @@ FILE: jvm.kt public constructor(): super() public final function use(): R|kotlin/Unit| { - #.#(Int(1)) - #.#(Int(2), Int(3)) + R|/Wrapper.list|.#(Int(1)) + R|/Wrapper.list|.#(Int(2), Int(3)) } }