[FIR IDE] Add unwrapping substitution overrides which doesn't affect function's signature
Also, do not use PSI to restore SUBSTITUTION_OVERRIDE function/property symbols
This commit is contained in:
committed by
teamcityserver
parent
2766dc938b
commit
fa8bb47bdf
+12
@@ -36,6 +36,18 @@ public class KtFe10SymbolByReferenceTestGenerated extends AbstractKtFe10SymbolBy
|
||||
runTest("analysis/analysis-api/testData/symbols/symbolByReference/constructorViaTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericFromFunctionInLocalClass.kt")
|
||||
public void testGenericFromFunctionInLocalClass() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/symbols/symbolByReference/genericFromFunctionInLocalClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericFromOuterClassInInnerClass.kt")
|
||||
public void testGenericFromOuterClassInInnerClass() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/symbols/symbolByReference/genericFromOuterClassInInnerClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("samConstructor.kt")
|
||||
public void testSamConstructor() throws Exception {
|
||||
|
||||
+96
-4
@@ -23,20 +23,22 @@ import org.jetbrains.kotlin.builtins.functions.FunctionClassKind
|
||||
import org.jetbrains.kotlin.fir.*
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirFieldImpl
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirOuterClassTypeParameterRef
|
||||
import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticProperty
|
||||
import org.jetbrains.kotlin.fir.java.declarations.FirJavaField
|
||||
import org.jetbrains.kotlin.fir.resolve.getContainingClass
|
||||
import org.jetbrains.kotlin.fir.resolve.getSymbolByLookupTag
|
||||
import org.jetbrains.kotlin.fir.resolve.originalConstructorIfTypeAlias
|
||||
import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutor
|
||||
import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutorByMap
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterLookupTag
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassifierSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl
|
||||
import org.jetbrains.kotlin.analysis.api.fir.symbols.KtFirClassInitializerSymbol
|
||||
import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutorByMap
|
||||
import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
@@ -206,6 +208,10 @@ internal class KtSymbolByFirBuilder private constructor(
|
||||
}
|
||||
|
||||
fun buildFunctionSymbol(fir: FirSimpleFunction): KtFirFunctionSymbol {
|
||||
fir.unwrapSubstitutionOverrideIfNeeded()?.let {
|
||||
return buildFunctionSymbol(it)
|
||||
}
|
||||
|
||||
check(fir.origin != FirDeclarationOrigin.SamConstructor)
|
||||
return symbolsCache.cache(fir) { KtFirFunctionSymbol(fir, resolveState, token, this@KtSymbolByFirBuilder) }
|
||||
}
|
||||
@@ -258,9 +264,14 @@ internal class KtSymbolByFirBuilder private constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun buildPropertySymbol(fir: FirProperty): KtKotlinPropertySymbol {
|
||||
fun buildPropertySymbol(fir: FirProperty): KtVariableSymbol {
|
||||
checkRequirementForBuildingSymbol<KtKotlinPropertySymbol>(fir, !fir.isLocal)
|
||||
checkRequirementForBuildingSymbol<KtKotlinPropertySymbol>(fir, fir !is FirSyntheticProperty)
|
||||
|
||||
fir.unwrapSubstitutionOverrideIfNeeded()?.let {
|
||||
return buildVariableSymbol(it)
|
||||
}
|
||||
|
||||
return symbolsCache.cache(fir) {
|
||||
KtFirKotlinPropertySymbol(fir, resolveState, token, this@KtSymbolByFirBuilder)
|
||||
}
|
||||
@@ -406,6 +417,44 @@ internal class KtSymbolByFirBuilder private constructor(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We want to unwrap a SUBSTITUTION_OVERRIDE wrapper if it doesn't affect the declaration's signature in any way. If the signature
|
||||
* is somehow changed, then we want to keep the wrapper.
|
||||
*
|
||||
* If the declaration references only its own type parameters, or parameters from the outer declarations, then
|
||||
* we consider that it's signature will not be changed by the SUBSTITUTION_OVERRIDE, so the wrapper can be unwrapped.
|
||||
*
|
||||
* This have a few caveats when it comes to the inner classes. TODO Provide a reference to some more in-detail description of that.
|
||||
*
|
||||
* N.B. This functions lifts only a single layer of SUBSTITUTION_OVERRIDE at a time.
|
||||
*
|
||||
* @receiver A declaration that needs to be unwrapped.
|
||||
* @return An unsubstituted declaration ([originalForSubstitutionOverride]]) if it exists and if it does not have any change
|
||||
* in signature; `null` otherwise.
|
||||
*/
|
||||
private inline fun <reified T : FirCallableDeclaration> T.unwrapSubstitutionOverrideIfNeeded(): T? {
|
||||
val containingClass = getContainingClass(rootSession) ?: return null
|
||||
val originalDeclaration = originalForSubstitutionOverride ?: return null
|
||||
|
||||
val allowedTypeParameters = buildSet {
|
||||
// declaration's own parameters
|
||||
originalDeclaration.typeParameters.mapTo(this) { it.symbol.toLookupTag() }
|
||||
|
||||
// captured outer parameters
|
||||
containingClass.typeParameters.mapNotNullTo(this) {
|
||||
(it as? FirOuterClassTypeParameterRef)?.symbol?.toLookupTag()
|
||||
}
|
||||
}
|
||||
|
||||
val usedTypeParameters = collectReferencedTypeParameters(originalDeclaration)
|
||||
|
||||
return if (allowedTypeParameters.containsAll(usedTypeParameters)) {
|
||||
originalDeclaration
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private fun throwUnexpectedElementError(element: Any): Nothing {
|
||||
error("Unexpected ${element::class.simpleName}")
|
||||
@@ -427,7 +476,7 @@ internal class KtSymbolByFirBuilder private constructor(
|
||||
}
|
||||
|
||||
|
||||
private class BuilderCache<From, To: Any> private constructor(
|
||||
private class BuilderCache<From, To : Any> private constructor(
|
||||
private val cache: ConcurrentMap<From, To>,
|
||||
private val isReadOnly: Boolean
|
||||
) {
|
||||
@@ -452,3 +501,46 @@ internal fun FirElement.buildSymbol(builder: KtSymbolByFirBuilder) =
|
||||
|
||||
internal fun FirDeclaration.buildSymbol(builder: KtSymbolByFirBuilder) =
|
||||
builder.buildSymbol(this)
|
||||
|
||||
private fun collectReferencedTypeParameters(declaration: FirCallableDeclaration): Set<ConeTypeParameterLookupTag> {
|
||||
val allUsedTypeParameters = mutableSetOf<ConeTypeParameterLookupTag>()
|
||||
|
||||
declaration.accept(object : FirVisitorVoid() {
|
||||
override fun visitElement(element: FirElement) {
|
||||
element.acceptChildren(this)
|
||||
}
|
||||
|
||||
override fun visitSimpleFunction(simpleFunction: FirSimpleFunction) {
|
||||
simpleFunction.typeParameters.forEach { it.accept(this) }
|
||||
|
||||
simpleFunction.receiverTypeRef?.accept(this)
|
||||
simpleFunction.valueParameters.forEach { it.returnTypeRef.accept(this) }
|
||||
simpleFunction.returnTypeRef.accept(this)
|
||||
}
|
||||
|
||||
override fun visitProperty(property: FirProperty) {
|
||||
property.typeParameters.forEach { it.accept(this) }
|
||||
|
||||
property.receiverTypeRef?.accept(this)
|
||||
property.returnTypeRef.accept(this)
|
||||
}
|
||||
|
||||
override fun visitResolvedTypeRef(resolvedTypeRef: FirResolvedTypeRef) {
|
||||
super.visitResolvedTypeRef(resolvedTypeRef)
|
||||
|
||||
handleTypeRef(resolvedTypeRef)
|
||||
}
|
||||
|
||||
private fun handleTypeRef(resolvedTypeRef: FirResolvedTypeRef) {
|
||||
val resolvedType = resolvedTypeRef.type
|
||||
|
||||
resolvedType.forEachType {
|
||||
if (it is ConeTypeParameterType) {
|
||||
allUsedTypeParameters.add(it.lookupTag)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return allUsedTypeParameters
|
||||
}
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ internal class KtFirBackingFieldSymbol(
|
||||
}
|
||||
|
||||
override val owningProperty: KtKotlinPropertySymbol by propertyFirRef.withFirAndCache { fir ->
|
||||
builder.variableLikeBuilder.buildPropertySymbol(fir)
|
||||
builder.buildSymbol(fir) as KtKotlinPropertySymbol
|
||||
}
|
||||
|
||||
override fun createPointer(): KtSymbolPointer<KtBackingFieldSymbol> {
|
||||
|
||||
+5
-1
@@ -27,6 +27,7 @@ import org.jetbrains.kotlin.analysis.low.level.api.fir.api.FirModuleResolveState
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.containingClass
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin
|
||||
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||
import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.*
|
||||
@@ -92,7 +93,10 @@ internal class KtFirFunctionSymbol(
|
||||
override val visibility: Visibility get() = getVisibility()
|
||||
|
||||
override fun createPointer(): KtSymbolPointer<KtFunctionSymbol> {
|
||||
KtPsiBasedSymbolPointer.createForSymbolFromSource(this)?.let { return it }
|
||||
if (firRef.withFir { it.origin != FirDeclarationOrigin.SubstitutionOverride }) {
|
||||
KtPsiBasedSymbolPointer.createForSymbolFromSource(this)?.let { return it }
|
||||
}
|
||||
|
||||
return when (symbolKind) {
|
||||
KtSymbolKind.TOP_LEVEL -> firRef.withFir { fir ->
|
||||
KtFirTopLevelFunctionSymbolPointer(fir.symbol.callableId, fir.createSignature())
|
||||
|
||||
+5
-1
@@ -32,6 +32,7 @@ import org.jetbrains.kotlin.analysis.low.level.api.fir.api.FirModuleResolveState
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.containingClass
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin
|
||||
import org.jetbrains.kotlin.fir.declarations.FirProperty
|
||||
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||
import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticProperty
|
||||
@@ -115,7 +116,10 @@ internal class KtFirKotlinPropertySymbol(
|
||||
override val hasSetter: Boolean get() = firRef.withFir { it.setter != null }
|
||||
|
||||
override fun createPointer(): KtSymbolPointer<KtKotlinPropertySymbol> {
|
||||
KtPsiBasedSymbolPointer.createForSymbolFromSource(this)?.let { return it }
|
||||
if (firRef.withFir { it.origin != FirDeclarationOrigin.SubstitutionOverride }) {
|
||||
KtPsiBasedSymbolPointer.createForSymbolFromSource(this)?.let { return it }
|
||||
}
|
||||
|
||||
return when (symbolKind) {
|
||||
KtSymbolKind.TOP_LEVEL -> TODO("Creating symbol for top level properties is not supported yet")
|
||||
KtSymbolKind.CLASS_MEMBER -> firRef.withFir { fir ->
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.analysis.api.fir.scopes
|
||||
|
||||
import org.jetbrains.kotlin.analysis.api.fir.FirFrontendApiTestConfiguratorService
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.scopes.AbstractSubstitutionOverridesUnwrappingTest
|
||||
|
||||
abstract class AbstractFirSubstitutionOverridesUnwrappingTest : AbstractSubstitutionOverridesUnwrappingTest(FirFrontendApiTestConfiguratorService)
|
||||
-6
@@ -47,10 +47,4 @@ public class FirMemberScopeByFqNameTestGenerated extends AbstractFirMemberScopeB
|
||||
public void testMutableList() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/memberScopeByFqName/MutableList.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overridenFunctionWithGenericBound.kt")
|
||||
public void testOverridenFunctionWithGenericBound() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/memberScopeByFqName/overridenFunctionWithGenericBound.kt");
|
||||
}
|
||||
}
|
||||
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.analysis.api.fir.scopes;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class FirSubstitutionOverridesUnwrappingTestGenerated extends AbstractFirSubstitutionOverridesUnwrappingTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInSubstitutionOverridesUnwrapping() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassWithGenericBase1.kt")
|
||||
public void testClassWithGenericBase1() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase1.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassWithGenericBase2.kt")
|
||||
public void testClassWithGenericBase2() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassWithGenericBase3.kt")
|
||||
public void testClassWithGenericBase3() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase3.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassWithGenericBase4.kt")
|
||||
public void testClassWithGenericBase4() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase4.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("GenericFromFunctionInLocalClass1.kt")
|
||||
public void testGenericFromFunctionInLocalClass1() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass1.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("GenericFromFunctionInLocalClass2.kt")
|
||||
public void testGenericFromFunctionInLocalClass2() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("GenericFromOuterClassInInnerClass1.kt")
|
||||
public void testGenericFromOuterClassInInnerClass1() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass1.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("GenericFromOuterClassInInnerClass2.kt")
|
||||
public void testGenericFromOuterClassInInnerClass2() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("GenericFromOuterClassInInnerClassInInheritor1.kt")
|
||||
public void testGenericFromOuterClassInInnerClassInInheritor1() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor1.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("GenericFromOuterClassInInnerClassInInheritor2.kt")
|
||||
public void testGenericFromOuterClassInInnerClassInInheritor2() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("GenericFromOuterClassInInnerClassInInheritor3.kt")
|
||||
public void testGenericFromOuterClassInInnerClassInInheritor3() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor3.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("Implement_java_util_Collection.kt")
|
||||
public void testImplement_java_util_Collection() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/Implement_java_util_Collection.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("MemberFunctionWithOuterTypeParameterBound.kt")
|
||||
public void testMemberFunctionWithOuterTypeParameterBound() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberFunctionWithOuterTypeParameterBound.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("MemberPropertyWithOuterTypeParameterBound.kt")
|
||||
public void testMemberPropertyWithOuterTypeParameterBound() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberPropertyWithOuterTypeParameterBound.kt");
|
||||
}
|
||||
}
|
||||
+12
@@ -36,6 +36,18 @@ public class FirSymbolByReferenceTestGenerated extends AbstractFirSymbolByRefere
|
||||
runTest("analysis/analysis-api/testData/symbols/symbolByReference/constructorViaTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericFromFunctionInLocalClass.kt")
|
||||
public void testGenericFromFunctionInLocalClass() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/symbols/symbolByReference/genericFromFunctionInLocalClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericFromOuterClassInInnerClass.kt")
|
||||
public void testGenericFromOuterClassInInnerClass() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/symbols/symbolByReference/genericFromOuterClassInInnerClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("samConstructor.kt")
|
||||
public void testSamConstructor() throws Exception {
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.analysis.api.impl.base.test.scopes
|
||||
|
||||
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
|
||||
import org.jetbrains.kotlin.analysis.api.impl.barebone.test.FrontendApiTestConfiguratorService
|
||||
import org.jetbrains.kotlin.analysis.api.impl.barebone.test.expressionMarkerProvider
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.symbols.AbstractSymbolTest
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.DebugSymbolRenderer
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.KtClassLikeSymbol
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.KtSymbol
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.markers.KtSymbolWithMembers
|
||||
import org.jetbrains.kotlin.psi.KtClassLikeDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
||||
import org.jetbrains.kotlin.test.directives.ConfigurationDirectives
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
|
||||
abstract class AbstractSubstitutionOverridesUnwrappingTest(
|
||||
configurator: FrontendApiTestConfiguratorService
|
||||
) : AbstractSymbolTest(configurator) {
|
||||
|
||||
override fun KtAnalysisSession.collectSymbols(ktFile: KtFile, testServices: TestServices): List<KtSymbol> {
|
||||
val declarationUnderCaret = testServices.expressionMarkerProvider.getElementOfTypAtCaret<KtClassLikeDeclaration>(ktFile)
|
||||
val classSymbolUnderCaret = declarationUnderCaret.getSymbol() as KtClassLikeSymbol
|
||||
|
||||
require(classSymbolUnderCaret is KtSymbolWithMembers)
|
||||
|
||||
return classSymbolUnderCaret.getMemberScope().getAllSymbols().toList()
|
||||
}
|
||||
|
||||
override fun KtAnalysisSession.renderSymbolForComparison(symbol: KtSymbol): String {
|
||||
return with(DebugSymbolRenderer) { renderForSubstitutionOverrideUnwrappingTest(symbol) }
|
||||
}
|
||||
|
||||
override fun configureTest(builder: TestConfigurationBuilder) {
|
||||
super.configureTest(builder)
|
||||
with(builder) {
|
||||
defaultDirectives {
|
||||
+ConfigurationDirectives.WITH_STDLIB
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
-2
@@ -35,7 +35,7 @@ abstract class AbstractSymbolTest(configurator: FrontendApiTestConfiguratorServi
|
||||
collectSymbols(ktFile, testServices).map { symbol ->
|
||||
PointerWithRenderedSymbol(
|
||||
if (createPointers) symbol.createPointer() else null,
|
||||
with(DebugSymbolRenderer) { renderExtra(symbol) }
|
||||
renderSymbolForComparison(symbol)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -66,12 +66,17 @@ abstract class AbstractSymbolTest(configurator: FrontendApiTestConfiguratorServi
|
||||
pointersWithRendered.map { (pointer, expectedRender) ->
|
||||
val restored = pointer!!.restoreSymbol()
|
||||
?: error("Symbol $expectedRender was not restored")
|
||||
with(DebugSymbolRenderer) { renderExtra(restored) }
|
||||
|
||||
renderSymbolForComparison(restored)
|
||||
}
|
||||
}
|
||||
val actual = restored.joinToString(separator = "\n\n")
|
||||
testServices.assertions.assertEqualsToTestDataFileSibling(actual)
|
||||
}
|
||||
|
||||
protected open fun KtAnalysisSession.renderSymbolForComparison(symbol: KtSymbol): String {
|
||||
return with(DebugSymbolRenderer) { renderExtra(symbol) }
|
||||
}
|
||||
}
|
||||
|
||||
private object SymbolTestDirectives : SimpleDirectivesContainer() {
|
||||
|
||||
+27
-2
@@ -53,6 +53,26 @@ public object DebugSymbolRenderer {
|
||||
}
|
||||
}.toString()
|
||||
|
||||
public fun KtAnalysisSession.renderForSubstitutionOverrideUnwrappingTest(symbol: KtSymbol): String = Block().apply {
|
||||
if (symbol !is KtCallableSymbol) return@apply
|
||||
|
||||
renderSymbolHeader(symbol)
|
||||
|
||||
withIndent {
|
||||
renderProperty(KtCallableSymbol::callableIdIfNonLocal, symbol)
|
||||
if (symbol is KtNamedSymbol) {
|
||||
renderProperty(KtNamedSymbol::name, symbol)
|
||||
}
|
||||
renderProperty(KtCallableSymbol::origin, symbol)
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
(symbol as? KtPossibleMemberSymbol)?.getDispatchReceiverType()?.let { dispatchType ->
|
||||
appendLine().append("getDispatchReceiver()").append(": ")
|
||||
renderType(dispatchType)
|
||||
}
|
||||
}
|
||||
}.toString()
|
||||
|
||||
private fun Block.renderProperty(property: KProperty<*>, vararg args: Any) {
|
||||
try {
|
||||
appendLine().append(property.name).append(": ")
|
||||
@@ -63,9 +83,9 @@ public object DebugSymbolRenderer {
|
||||
}
|
||||
|
||||
private fun Block.renderSymbol(symbol: KtSymbol) {
|
||||
val apiClass = getSymbolApiClass(symbol)
|
||||
append(apiClass.simpleName).append(':')
|
||||
renderSymbolHeader(symbol)
|
||||
|
||||
val apiClass = getSymbolApiClass(symbol)
|
||||
withIndent {
|
||||
apiClass.members
|
||||
.asSequence()
|
||||
@@ -76,6 +96,11 @@ public object DebugSymbolRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
private fun Block.renderSymbolHeader(symbol: KtSymbol) {
|
||||
val apiClass = getSymbolApiClass(symbol)
|
||||
append(apiClass.simpleName).append(':')
|
||||
}
|
||||
|
||||
private fun Block.renderList(values: List<*>) {
|
||||
if (values.isEmpty()) {
|
||||
append("[]")
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { 1 -> (r: kotlin.Int) }
|
||||
targetFunction = /A.foo(<dispatch receiver>: A<kotlin.String>, r: kotlin.Int): kotlin.Unit
|
||||
substitutor = <map substitutor: {R = kotlin/Int}>
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { 1 -> (r: kotlin.Int) }
|
||||
targetFunction = /A.foo(<dispatch receiver>: A<kotlin.String>, r: kotlin.Int): kotlin.Unit
|
||||
targetFunction = /A.foo(<dispatch receiver>: A<T>, r: R): kotlin.Unit
|
||||
substitutor = <map substitutor: {R = kotlin/Int}>
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
Resolved to:
|
||||
0: (in kotlin.collections.IntIterator) abstract operator fun hasNext(): kotlin.Boolean
|
||||
1: (in kotlin.collections.IntIterator) operator fun next(): kotlin.Int
|
||||
0: (in kotlin.collections.IntIterator) operator fun next(): kotlin.Int
|
||||
1: (in kotlin.collections.Iterator) operator fun hasNext(): kotlin.Boolean
|
||||
2: (in kotlin.ranges.IntProgression) open operator fun iterator(): kotlin.collections.IntIterator
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
Resolved to:
|
||||
0: (in kotlin.collections.CharIterator) abstract operator fun hasNext(): kotlin.Boolean
|
||||
1: (in kotlin.collections.CharIterator) operator fun next(): kotlin.Char
|
||||
0: (in kotlin.collections.CharIterator) operator fun next(): kotlin.Char
|
||||
1: (in kotlin.collections.Iterator) operator fun hasNext(): kotlin.Boolean
|
||||
2: (in kotlin.text) operator fun kotlin.CharSequence.iterator(): kotlin.collections.CharIterator
|
||||
@@ -442,7 +442,7 @@ KtFunctionSymbol:
|
||||
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: kotlin/collections/MutableList.isEmpty
|
||||
callableIdIfNonLocal: kotlin/collections/List.isEmpty
|
||||
hasStableParameterNames: true
|
||||
isExtension: false
|
||||
isExternal: false
|
||||
@@ -461,7 +461,7 @@ KtFunctionSymbol:
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getDispatchReceiver(): kotlin/collections/MutableList<E>
|
||||
getDispatchReceiver(): kotlin/collections/List<E>
|
||||
deprecationStatus: null
|
||||
|
||||
KtFunctionSymbol:
|
||||
@@ -516,10 +516,10 @@ KtFunctionSymbol:
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: kotlin/collections/MutableList.size
|
||||
getter: null
|
||||
callableIdIfNonLocal: kotlin/collections/List.size
|
||||
getter: KtPropertyGetterSymbol(<getter>)
|
||||
hasBackingField: false
|
||||
hasGetter: false
|
||||
hasGetter: true
|
||||
hasSetter: false
|
||||
initializer: null
|
||||
isConst: false
|
||||
@@ -539,7 +539,7 @@ KtKotlinPropertySymbol:
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getDispatchReceiver(): kotlin/collections/MutableList<E>
|
||||
getDispatchReceiver(): kotlin/collections/List<E>
|
||||
deprecationStatus: null
|
||||
getterDeprecationStatus: null
|
||||
javaGetterName: getSize
|
||||
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
package test
|
||||
|
||||
class Foo
|
||||
|
||||
abstract class Base<T> {
|
||||
fun noGeneric() {}
|
||||
|
||||
fun withOuterGeneric(t: T) {}
|
||||
|
||||
fun <TT> withOwnGeneric(tt: TT) {}
|
||||
|
||||
fun <TT> withOuterAndOwnGeneric(t: T, tt: TT) {}
|
||||
}
|
||||
|
||||
class <caret>ClassWithGenericBase : Base<Foo>()
|
||||
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/Base.noGeneric
|
||||
name: noGeneric
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/Base<T>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/ClassWithGenericBase.withOuterGeneric
|
||||
name: withOuterGeneric
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/ClassWithGenericBase
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/Base.withOwnGeneric
|
||||
name: withOwnGeneric
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/Base<T>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/ClassWithGenericBase.withOuterAndOwnGeneric
|
||||
name: withOuterAndOwnGeneric
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/ClassWithGenericBase
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.equals
|
||||
name: equals
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||
name: hashCode
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.toString
|
||||
name: toString
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtConstructorSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
package test
|
||||
|
||||
class Foo
|
||||
|
||||
abstract class Base<T> {
|
||||
val noGeneric: Foo? = null
|
||||
|
||||
val withOuterGeneric: T? = null
|
||||
|
||||
val <TT> TT.withOwnGeneric: TT? get() = null
|
||||
|
||||
val <TT> TT.withOuterAndOwnGeneric: T? get() = null
|
||||
}
|
||||
|
||||
class <caret>ClassWithGenericBase : Base<Foo>()
|
||||
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/Base.noGeneric
|
||||
name: noGeneric
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/Base<T>
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/ClassWithGenericBase.withOuterGeneric
|
||||
name: withOuterGeneric
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/ClassWithGenericBase
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/Base.withOwnGeneric
|
||||
name: withOwnGeneric
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/Base<T>
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/ClassWithGenericBase.withOuterAndOwnGeneric
|
||||
name: withOuterAndOwnGeneric
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/ClassWithGenericBase
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.equals
|
||||
name: equals
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||
name: hashCode
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.toString
|
||||
name: toString
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtConstructorSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
package test
|
||||
|
||||
class SomeClass1
|
||||
class SomeClass2
|
||||
|
||||
interface InterfaceWithFunBase<T1, T2> {
|
||||
fun noGenerics_InterfaceWithFunBase() {}
|
||||
|
||||
fun withOuterGenericT1_InterfaceWithFunBase(): T1 {}
|
||||
|
||||
fun withOuterGenericT2_InterfaceWithFunBase(): T2 {}
|
||||
}
|
||||
|
||||
interface InterfaceWithFun<T> : InterfaceWithFunBase<SomeClass1, T> {
|
||||
fun noGenerics_InterfaceWithFun() {}
|
||||
|
||||
fun withOuterGeneric_InterfaceWithFun(): T {}
|
||||
}
|
||||
|
||||
abstract class <caret>ClassWithInterfaceWithFun : InterfaceWithFun<SomeClass2>
|
||||
Vendored
+51
@@ -0,0 +1,51 @@
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/InterfaceWithFun.noGenerics_InterfaceWithFun
|
||||
name: noGenerics_InterfaceWithFun
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/InterfaceWithFun<T>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/ClassWithInterfaceWithFun.withOuterGeneric_InterfaceWithFun
|
||||
name: withOuterGeneric_InterfaceWithFun
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/ClassWithInterfaceWithFun
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/InterfaceWithFunBase.noGenerics_InterfaceWithFunBase
|
||||
name: noGenerics_InterfaceWithFunBase
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/InterfaceWithFunBase<T1, T2>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/InterfaceWithFun.withOuterGenericT1_InterfaceWithFunBase
|
||||
name: withOuterGenericT1_InterfaceWithFunBase
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/InterfaceWithFun<T>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/ClassWithInterfaceWithFun.withOuterGenericT2_InterfaceWithFunBase
|
||||
name: withOuterGenericT2_InterfaceWithFunBase
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/ClassWithInterfaceWithFun
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.equals
|
||||
name: equals
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||
name: hashCode
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.toString
|
||||
name: toString
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtConstructorSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
package test
|
||||
|
||||
class SomeClass1
|
||||
class SomeClass2
|
||||
|
||||
interface InterfaceWithValBase<T1, T2> {
|
||||
val noGenerics_InterfaceWithValBase: SomeClass1
|
||||
|
||||
val withOuterGenericT1_InterfaceWithValBase: T1
|
||||
|
||||
val withOuterGenericT2_InterfaceWithValBase: T2
|
||||
|
||||
val <Own> Own.withOwnGeneric_InterfaceWithValBase: SomeClass1
|
||||
|
||||
val <Own> Own.withOwnAndOuterGenericT1_InterfaceWithValBase: T1
|
||||
|
||||
val <Own> Own.withOwnAndOuterGenericT2_InterfaceWithValBase: T2
|
||||
}
|
||||
|
||||
interface InterfaceWithVal<T> : InterfaceWithValBase<SomeClass1, T> {
|
||||
val noGenerics_InterfaceWithVal: SomeClass1
|
||||
|
||||
val withOuterGeneric_InterfaceWithVal: T
|
||||
|
||||
val <Own> Own.withOwnGeneric_InterfaceWithVal: SomeClass1
|
||||
|
||||
val <Own> Own.withOwnAndOuterGeneric_InterfaceWithVal: T
|
||||
}
|
||||
|
||||
|
||||
abstract class <caret>ClassWithInterfaceWithVal : InterfaceWithVal<SomeClass2>
|
||||
Vendored
+81
@@ -0,0 +1,81 @@
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/InterfaceWithVal.noGenerics_InterfaceWithVal
|
||||
name: noGenerics_InterfaceWithVal
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/InterfaceWithVal<T>
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/ClassWithInterfaceWithVal.withOuterGeneric_InterfaceWithVal
|
||||
name: withOuterGeneric_InterfaceWithVal
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/ClassWithInterfaceWithVal
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/InterfaceWithVal.withOwnGeneric_InterfaceWithVal
|
||||
name: withOwnGeneric_InterfaceWithVal
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/InterfaceWithVal<T>
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/ClassWithInterfaceWithVal.withOwnAndOuterGeneric_InterfaceWithVal
|
||||
name: withOwnAndOuterGeneric_InterfaceWithVal
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/ClassWithInterfaceWithVal
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/InterfaceWithValBase.noGenerics_InterfaceWithValBase
|
||||
name: noGenerics_InterfaceWithValBase
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/InterfaceWithValBase<T1, T2>
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/InterfaceWithVal.withOuterGenericT1_InterfaceWithValBase
|
||||
name: withOuterGenericT1_InterfaceWithValBase
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/InterfaceWithVal<T>
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/ClassWithInterfaceWithVal.withOuterGenericT2_InterfaceWithValBase
|
||||
name: withOuterGenericT2_InterfaceWithValBase
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/ClassWithInterfaceWithVal
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/InterfaceWithValBase.withOwnGeneric_InterfaceWithValBase
|
||||
name: withOwnGeneric_InterfaceWithValBase
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/InterfaceWithValBase<T1, T2>
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/InterfaceWithVal.withOwnAndOuterGenericT1_InterfaceWithValBase
|
||||
name: withOwnAndOuterGenericT1_InterfaceWithValBase
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/InterfaceWithVal<T>
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/ClassWithInterfaceWithVal.withOwnAndOuterGenericT2_InterfaceWithValBase
|
||||
name: withOwnAndOuterGenericT2_InterfaceWithValBase
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/ClassWithInterfaceWithVal
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.equals
|
||||
name: equals
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||
name: hashCode
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.toString
|
||||
name: toString
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtConstructorSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// DO_NOT_CHECK_SYMBOL_RESTORE
|
||||
package test
|
||||
|
||||
class SomeClass
|
||||
|
||||
fun <Outer> topLevel() {
|
||||
open class Base {
|
||||
fun withOuter(): Outer? = null
|
||||
}
|
||||
|
||||
class <caret>Child : Base() {
|
||||
fun noGenerics() {}
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
name: noGenerics
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/Child<Outer>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
name: withOuter
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/Base<Outer>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.equals
|
||||
name: equals
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||
name: hashCode
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.toString
|
||||
name: toString
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtConstructorSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// DO_NOT_CHECK_SYMBOL_RESTORE
|
||||
package test
|
||||
|
||||
class SomeClass
|
||||
|
||||
fun <Outer> topLevel() {
|
||||
open class Base<T> {
|
||||
fun withOuter(): Outer? = null
|
||||
fun withOuterAndOwn(t: T): Outer? = null
|
||||
}
|
||||
|
||||
class <caret>Child : Base<SomeClass>() {
|
||||
fun noGenerics() {}
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
name: noGenerics
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/Child<Outer>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
name: withOuter
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/Base<T, Outer>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
name: withOuterAndOwn
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/Child<Outer>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.equals
|
||||
name: equals
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||
name: hashCode
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.toString
|
||||
name: toString
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtConstructorSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
class SomeClass
|
||||
|
||||
open class TopLevel<Outer> {
|
||||
open inner class Base {
|
||||
fun noGeneric() {}
|
||||
fun withOuter(): Outer? = null
|
||||
}
|
||||
inner class <caret>Child : Base()
|
||||
}
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/TopLevel.Base.noGeneric
|
||||
name: noGeneric
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/TopLevel.Base<Outer>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/TopLevel.Base.withOuter
|
||||
name: withOuter
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/TopLevel.Base<Outer>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.equals
|
||||
name: equals
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||
name: hashCode
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.toString
|
||||
name: toString
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtConstructorSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
getDispatchReceiver(): test/TopLevel<Outer>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
class SomeClass
|
||||
|
||||
open class TopLevel<Outer> {
|
||||
open inner class Base<T> {
|
||||
fun noGeneric() {}
|
||||
fun withOuter(): Outer? = null
|
||||
fun withOwnAndOuter(t: T): Outer? = null
|
||||
}
|
||||
|
||||
inner class <caret>Child : Base<SomeClass>()
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/TopLevel.Base.noGeneric
|
||||
name: noGeneric
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/TopLevel.Base<T, Outer>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/TopLevel.Base.withOuter
|
||||
name: withOuter
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/TopLevel.Base<T, Outer>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/TopLevel.Child.withOwnAndOuter
|
||||
name: withOwnAndOuter
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/TopLevel.Child<Outer>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.equals
|
||||
name: equals
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||
name: hashCode
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.toString
|
||||
name: toString
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtConstructorSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
getDispatchReceiver(): test/TopLevel<Outer>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
class SomeClass
|
||||
|
||||
open class TopLevel<Outer> {
|
||||
open inner class Base {
|
||||
fun noGeneric() {}
|
||||
fun withOuter(): Outer? = null
|
||||
}
|
||||
}
|
||||
|
||||
class OtherTopLevel : TopLevel<SomeClass>() {
|
||||
inner class <caret>Child : Base()
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/TopLevel.Base.noGeneric
|
||||
name: noGeneric
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/TopLevel.Base<Outer>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/OtherTopLevel.Child.withOuter
|
||||
name: withOuter
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/OtherTopLevel.Child
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.equals
|
||||
name: equals
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||
name: hashCode
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.toString
|
||||
name: toString
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtConstructorSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
getDispatchReceiver(): test/OtherTopLevel
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
class SomeClass
|
||||
|
||||
open class TopLevel<Outer> {
|
||||
open inner class Base {
|
||||
fun noGeneric() {}
|
||||
fun withOuter(): Outer? = null
|
||||
}
|
||||
}
|
||||
|
||||
class OtherTopLevel<T> : TopLevel<T>() {
|
||||
inner class <caret>Child : Base()
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/TopLevel.Base.noGeneric
|
||||
name: noGeneric
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/TopLevel.Base<Outer>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/OtherTopLevel.Child.withOuter
|
||||
name: withOuter
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/OtherTopLevel.Child<T>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.equals
|
||||
name: equals
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||
name: hashCode
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.toString
|
||||
name: toString
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtConstructorSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
getDispatchReceiver(): test/OtherTopLevel<T>
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package test
|
||||
|
||||
class SomeClass
|
||||
|
||||
open class TopLevel<Outer> {
|
||||
open inner class Base<T> {
|
||||
fun noGeneric() {}
|
||||
fun withOuter(): Outer? = null
|
||||
fun withOwnAndOuter(t: T): Outer? = null
|
||||
}
|
||||
}
|
||||
|
||||
class OtherTopLevel : TopLevel<SomeClass>() {
|
||||
inner class <caret>Child : Base<SomeClass>()
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/TopLevel.Base.noGeneric
|
||||
name: noGeneric
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/TopLevel.Base<T, Outer>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/OtherTopLevel.Child.withOuter
|
||||
name: withOuter
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/OtherTopLevel.Child
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/OtherTopLevel.Child.withOwnAndOuter
|
||||
name: withOwnAndOuter
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/OtherTopLevel.Child
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.equals
|
||||
name: equals
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||
name: hashCode
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.toString
|
||||
name: toString
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtConstructorSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
getDispatchReceiver(): test/OtherTopLevel
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package test
|
||||
|
||||
class SomeClass
|
||||
|
||||
abstract class <caret>MyList : java.util.Collection<SomeClass>
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: java/util/Collection.size
|
||||
name: size
|
||||
origin: JAVA
|
||||
getDispatchReceiver(): java/util/Collection<E>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: java/util/Collection.isEmpty
|
||||
name: isEmpty
|
||||
origin: JAVA
|
||||
getDispatchReceiver(): java/util/Collection<E>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: java/util/Collection.contains
|
||||
name: contains
|
||||
origin: JAVA
|
||||
getDispatchReceiver(): java/util/Collection<E>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/MyList.iterator
|
||||
name: iterator
|
||||
origin: JAVA
|
||||
getDispatchReceiver(): test/MyList
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: java/util/Collection.toArray
|
||||
name: toArray
|
||||
origin: JAVA
|
||||
getDispatchReceiver(): java/util/Collection<E>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: java/util/Collection.toArray
|
||||
name: toArray
|
||||
origin: JAVA
|
||||
getDispatchReceiver(): java/util/Collection<E>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/MyList.add
|
||||
name: add
|
||||
origin: JAVA
|
||||
getDispatchReceiver(): test/MyList
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: java/util/Collection.remove
|
||||
name: remove
|
||||
origin: JAVA
|
||||
getDispatchReceiver(): java/util/Collection<E>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: java/util/Collection.containsAll
|
||||
name: containsAll
|
||||
origin: JAVA
|
||||
getDispatchReceiver(): java/util/Collection<E>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/MyList.addAll
|
||||
name: addAll
|
||||
origin: JAVA
|
||||
getDispatchReceiver(): test/MyList
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: java/util/Collection.removeAll
|
||||
name: removeAll
|
||||
origin: JAVA
|
||||
getDispatchReceiver(): java/util/Collection<E>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: java/util/Collection.retainAll
|
||||
name: retainAll
|
||||
origin: JAVA
|
||||
getDispatchReceiver(): java/util/Collection<E>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: java/util/Collection.clear
|
||||
name: clear
|
||||
origin: JAVA
|
||||
getDispatchReceiver(): java/util/Collection<E>
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.equals
|
||||
name: equals
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||
name: hashCode
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.toString
|
||||
name: toString
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtConstructorSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
+1
-5
@@ -1,7 +1,5 @@
|
||||
// DO_NOT_CHECK_SYMBOL_RESTORE
|
||||
package test
|
||||
|
||||
|
||||
interface OtherInterface
|
||||
|
||||
interface TwoParams<T, TT>
|
||||
@@ -14,6 +12,4 @@ interface MyInterface<T> {
|
||||
|
||||
class Foo
|
||||
|
||||
abstract class MyClass : MyInterface<Foo>
|
||||
|
||||
// class: test/MyClass
|
||||
abstract class <caret>MyClass : MyInterface<Foo>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: test/MyClass.funWithOuterAndOwnGenericsAndBounds
|
||||
name: funWithOuterAndOwnGenericsAndBounds
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/MyClass
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/MyClass.propWithOuterAndOwnGenericsAndBounds
|
||||
name: propWithOuterAndOwnGenericsAndBounds
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/MyClass
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.equals
|
||||
name: equals
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||
name: hashCode
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.toString
|
||||
name: toString
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtConstructorSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package test
|
||||
|
||||
interface ClassA
|
||||
interface ClassB
|
||||
|
||||
interface MyInterface<T> {
|
||||
val <Own : ClassA> Own.withOwnGeneric_InterfaceWithValBase: ClassA
|
||||
val <Own : T> Own.withOwnAndOuterGenericAsTypeBound_InterfaceWithValBase: ClassA
|
||||
}
|
||||
|
||||
abstract class <caret>Inheritor : MyInterface<ClassB>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/MyInterface.withOwnGeneric_InterfaceWithValBase
|
||||
name: withOwnGeneric_InterfaceWithValBase
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/MyInterface<T>
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
callableIdIfNonLocal: test/Inheritor.withOwnAndOuterGenericAsTypeBound_InterfaceWithValBase
|
||||
name: withOwnAndOuterGenericAsTypeBound_InterfaceWithValBase
|
||||
origin: SOURCE
|
||||
getDispatchReceiver(): test/Inheritor
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.equals
|
||||
name: equals
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||
name: hashCode
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtFunctionSymbol:
|
||||
callableIdIfNonLocal: kotlin/Any.toString
|
||||
name: toString
|
||||
origin: LIBRARY
|
||||
getDispatchReceiver(): kotlin/Any
|
||||
|
||||
KtConstructorSymbol:
|
||||
callableIdIfNonLocal: null
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// DO_NOT_CHECK_SYMBOL_RESTORE
|
||||
package test
|
||||
|
||||
class SomeClass
|
||||
|
||||
fun <Outer> topLevel() {
|
||||
open class Base {
|
||||
fun withOuter(): Outer? = null
|
||||
}
|
||||
|
||||
class Child : Base() {}
|
||||
|
||||
Child().<caret>withOuter()
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
hasStableParameterNames: true
|
||||
isExtension: false
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: withOuter
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
returnType: Outer?
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getDispatchReceiver(): test/Base<Outer>
|
||||
deprecationStatus: null
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: test/TopLevel.Child.withOuter
|
||||
hasStableParameterNames: true
|
||||
isExtension: false
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: withOuter
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
returnType: Outer?
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getDispatchReceiver(): test/TopLevel<Outer>.test/TopLevel.Base<test/SomeClass>
|
||||
deprecationStatus: null
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// DO_NOT_CHECK_SYMBOL_RESTORE
|
||||
package test
|
||||
|
||||
class SomeClass
|
||||
|
||||
class TopLevel<Outer> {
|
||||
inner open class Base<T> {
|
||||
fun withOuter(): Outer? = null
|
||||
}
|
||||
|
||||
inner class Child : Base<SomeClass> {}
|
||||
|
||||
fun usage() {
|
||||
Child().<caret>withOuter()
|
||||
}
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: test/TopLevel.Base.withOuter
|
||||
hasStableParameterNames: true
|
||||
isExtension: false
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: withOuter
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
returnType: Outer?
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getDispatchReceiver(): test/TopLevel.Base<T, Outer>
|
||||
deprecationStatus: null
|
||||
+8
@@ -44,6 +44,7 @@ import org.jetbrains.kotlin.analysis.api.fir.components.typeProvider.AbstractFir
|
||||
import org.jetbrains.kotlin.analysis.api.fir.components.typeProvider.AbstractFirHasCommonSubtypeTest
|
||||
import org.jetbrains.kotlin.analysis.api.fir.scopes.AbstractFirDelegateMemberScopeTest
|
||||
import org.jetbrains.kotlin.analysis.api.fir.scopes.AbstractFirFileScopeTest
|
||||
import org.jetbrains.kotlin.analysis.api.fir.scopes.AbstractFirSubstitutionOverridesUnwrappingTest
|
||||
import org.jetbrains.kotlin.analysis.api.fir.scopes.AbstractFirMemberScopeByFqNameTest
|
||||
import org.jetbrains.kotlin.analysis.api.fir.symbols.AbstractFirSymbolByFqNameTest
|
||||
import org.jetbrains.kotlin.analysis.api.fir.symbols.AbstractFirSymbolByPsiTest
|
||||
@@ -64,6 +65,13 @@ private fun TestGroupSuite.generateAnalysisApiNonComponentsTests() {
|
||||
}
|
||||
|
||||
group("scopes") {
|
||||
test(
|
||||
fir = AbstractFirSubstitutionOverridesUnwrappingTest::class,
|
||||
fe10 = null,
|
||||
) {
|
||||
model("substitutionOverridesUnwrapping")
|
||||
}
|
||||
|
||||
test(
|
||||
fir = AbstractFirMemberScopeByFqNameTest::class,
|
||||
fe10 = null,
|
||||
|
||||
Reference in New Issue
Block a user