[AA] Fix KDoc reference resolution of non-imported companion object members
- Similar to the fix for KTIJ-25995, the name interpretation collector needs to consider the companion object's member scope as well. ^KTIJ-25995
This commit is contained in:
committed by
Space Team
parent
0add17d9da
commit
ef484c7518
+6
@@ -1930,6 +1930,12 @@ public class Fe10IdeNormalAnalysisSourceModuleReferenceResolveTestGenerated exte
|
|||||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/withErrors/invalidPropertyAccessOnFunctionFromCompanionObject.kt");
|
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/withErrors/invalidPropertyAccessOnFunctionFromCompanionObject.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("invalidPropertyAccessOnFunctionFromNonImportedCompanionObject.kt")
|
||||||
|
public void testInvalidPropertyAccessOnFunctionFromNonImportedCompanionObject() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/withErrors/invalidPropertyAccessOnFunctionFromNonImportedCompanionObject.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("invalidPropertyAccessOnFunctionFromSuperClass.kt")
|
@TestMetadata("invalidPropertyAccessOnFunctionFromSuperClass.kt")
|
||||||
public void testInvalidPropertyAccessOnFunctionFromSuperClass() throws Exception {
|
public void testInvalidPropertyAccessOnFunctionFromSuperClass() throws Exception {
|
||||||
|
|||||||
+1
-1
@@ -264,7 +264,7 @@ internal object KDocReferenceResolver {
|
|||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
getClassOrObjectSymbolByClassId(classId)
|
getClassOrObjectSymbolByClassId(classId)
|
||||||
?.getCombinedMemberScope()
|
?.getCompositeCombinedMemberAndCompanionObjectScope()
|
||||||
?.getCallableSymbols(callableId.callableName)
|
?.getCallableSymbols(callableId.callableName)
|
||||||
?.let(::addAll)
|
?.let(::addAll)
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -1930,6 +1930,12 @@ public class FirIdeDependentAnalysisSourceModuleReferenceResolveTestGenerated ex
|
|||||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/withErrors/invalidPropertyAccessOnFunctionFromCompanionObject.kt");
|
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/withErrors/invalidPropertyAccessOnFunctionFromCompanionObject.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("invalidPropertyAccessOnFunctionFromNonImportedCompanionObject.kt")
|
||||||
|
public void testInvalidPropertyAccessOnFunctionFromNonImportedCompanionObject() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/withErrors/invalidPropertyAccessOnFunctionFromNonImportedCompanionObject.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("invalidPropertyAccessOnFunctionFromSuperClass.kt")
|
@TestMetadata("invalidPropertyAccessOnFunctionFromSuperClass.kt")
|
||||||
public void testInvalidPropertyAccessOnFunctionFromSuperClass() throws Exception {
|
public void testInvalidPropertyAccessOnFunctionFromSuperClass() throws Exception {
|
||||||
|
|||||||
+6
@@ -1930,6 +1930,12 @@ public class FirIdeNormalAnalysisSourceModuleReferenceResolveTestGenerated exten
|
|||||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/withErrors/invalidPropertyAccessOnFunctionFromCompanionObject.kt");
|
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/withErrors/invalidPropertyAccessOnFunctionFromCompanionObject.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("invalidPropertyAccessOnFunctionFromNonImportedCompanionObject.kt")
|
||||||
|
public void testInvalidPropertyAccessOnFunctionFromNonImportedCompanionObject() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/withErrors/invalidPropertyAccessOnFunctionFromNonImportedCompanionObject.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("invalidPropertyAccessOnFunctionFromSuperClass.kt")
|
@TestMetadata("invalidPropertyAccessOnFunctionFromSuperClass.kt")
|
||||||
public void testInvalidPropertyAccessOnFunctionFromSuperClass() throws Exception {
|
public void testInvalidPropertyAccessOnFunctionFromSuperClass() throws Exception {
|
||||||
|
|||||||
+6
@@ -1930,6 +1930,12 @@ public class FirStandaloneNormalAnalysisSourceModuleReferenceResolveTestGenerate
|
|||||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/withErrors/invalidPropertyAccessOnFunctionFromCompanionObject.kt");
|
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/withErrors/invalidPropertyAccessOnFunctionFromCompanionObject.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("invalidPropertyAccessOnFunctionFromNonImportedCompanionObject.kt")
|
||||||
|
public void testInvalidPropertyAccessOnFunctionFromNonImportedCompanionObject() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/withErrors/invalidPropertyAccessOnFunctionFromNonImportedCompanionObject.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("invalidPropertyAccessOnFunctionFromSuperClass.kt")
|
@TestMetadata("invalidPropertyAccessOnFunctionFromSuperClass.kt")
|
||||||
public void testInvalidPropertyAccessOnFunctionFromSuperClass() throws Exception {
|
public void testInvalidPropertyAccessOnFunctionFromSuperClass() throws Exception {
|
||||||
|
|||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
// FILE: A.kt
|
||||||
|
package bar
|
||||||
|
|
||||||
|
class A {
|
||||||
|
companion object {
|
||||||
|
fun toName(): String = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
package baz
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [bar.A.<caret>toName.length]
|
||||||
|
*/
|
||||||
|
fun foo() {}
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
Resolved to:
|
||||||
|
0: (in bar.A.Companion) fun toName(): kotlin.String
|
||||||
Reference in New Issue
Block a user