[Analysis API] add tests for KtTypeScope

This commit is contained in:
Ilya Kirillov
2022-06-13 14:39:46 +02:00
parent b9907963fe
commit 36f370f501
25 changed files with 2072 additions and 4 deletions
@@ -0,0 +1,84 @@
/*
* 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.test.cases.generated.cases.scopes;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.analysis.api.fir.test.configurators.AnalysisApiFirTestConfiguratorFactory;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.scopes.AbstractTypeScopeTest;
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/components/scopeProvider/typeScope")
@TestDataPath("$PROJECT_ROOT")
public class FirIdeDependentAnalysisSourceModuleTypeScopeTestGenerated extends AbstractTypeScopeTest {
@NotNull
@Override
public AnalysisApiTestConfigurator getConfigurator() {
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
new AnalysisApiTestConfiguratorFactoryData(
FrontendKind.Fir,
TestModuleKind.Source,
AnalysisSessionMode.Dependent,
AnalysisApiMode.Ide
)
);
}
@Test
public void testAllFilesPresentInTypeScope() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/typeScope"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("errorType.kt")
public void testErrorType() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/errorType.kt");
}
@Test
@TestMetadata("innerClassTypeParamsSubstitution.kt")
public void testInnerClassTypeParamsSubstitution() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/innerClassTypeParamsSubstitution.kt");
}
@Test
@TestMetadata("intList.kt")
public void testIntList() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/intList.kt");
}
@Test
@TestMetadata("outerClassTypeParamsSubstitution.kt")
public void testOuterClassTypeParamsSubstitution() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/outerClassTypeParamsSubstitution.kt");
}
@Test
@TestMetadata("outerTypeParamsSubstitution.kt")
public void testOuterTypeParamsSubstitution() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/outerTypeParamsSubstitution.kt");
}
@Test
@TestMetadata("typeParamList.kt")
public void testTypeParamList() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/typeParamList.kt");
}
}
@@ -0,0 +1,84 @@
/*
* 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.test.cases.generated.cases.scopes;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.analysis.api.fir.test.configurators.AnalysisApiFirTestConfiguratorFactory;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.scopes.AbstractTypeScopeTest;
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/components/scopeProvider/typeScope")
@TestDataPath("$PROJECT_ROOT")
public class FirIdeNormalAnalysisSourceModuleTypeScopeTestGenerated extends AbstractTypeScopeTest {
@NotNull
@Override
public AnalysisApiTestConfigurator getConfigurator() {
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
new AnalysisApiTestConfiguratorFactoryData(
FrontendKind.Fir,
TestModuleKind.Source,
AnalysisSessionMode.Normal,
AnalysisApiMode.Ide
)
);
}
@Test
public void testAllFilesPresentInTypeScope() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/typeScope"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("errorType.kt")
public void testErrorType() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/errorType.kt");
}
@Test
@TestMetadata("innerClassTypeParamsSubstitution.kt")
public void testInnerClassTypeParamsSubstitution() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/innerClassTypeParamsSubstitution.kt");
}
@Test
@TestMetadata("intList.kt")
public void testIntList() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/intList.kt");
}
@Test
@TestMetadata("outerClassTypeParamsSubstitution.kt")
public void testOuterClassTypeParamsSubstitution() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/outerClassTypeParamsSubstitution.kt");
}
@Test
@TestMetadata("outerTypeParamsSubstitution.kt")
public void testOuterTypeParamsSubstitution() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/outerTypeParamsSubstitution.kt");
}
@Test
@TestMetadata("typeParamList.kt")
public void testTypeParamList() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/typeParamList.kt");
}
}
@@ -12,9 +12,14 @@ import org.jetbrains.kotlin.analysis.api.calls.KtCall
import org.jetbrains.kotlin.analysis.api.calls.KtCallableMemberCall
import org.jetbrains.kotlin.analysis.api.diagnostics.KtDiagnostic
import org.jetbrains.kotlin.analysis.api.impl.base.KtMapBackedSubstitutor
import org.jetbrains.kotlin.analysis.api.signatures.KtCallableSignature
import org.jetbrains.kotlin.analysis.api.signatures.KtFunctionLikeSignature
import org.jetbrains.kotlin.analysis.api.signatures.KtVariableLikeSignature
import org.jetbrains.kotlin.analysis.api.symbols.*
import org.jetbrains.kotlin.analysis.api.symbols.markers.KtNamedSymbol
import org.jetbrains.kotlin.analysis.api.types.KtSubstitutor
import org.jetbrains.kotlin.analysis.api.types.KtType
import org.jetbrains.kotlin.analysis.utils.printer.prettyPrint
import org.jetbrains.kotlin.name.CallableId
import org.jetbrains.kotlin.name.Name
import kotlin.reflect.KProperty1
@@ -105,6 +110,35 @@ internal fun KtAnalysisSession.stringRepresentation(any: Any): String = with(any
}
}
internal fun KtAnalysisSession.prettyPrintSignature(signature: KtCallableSignature<*>): String = prettyPrint {
when (signature) {
is KtFunctionLikeSignature -> {
append("fun ")
signature.receiverType?.let { append('.'); append(it.render()) }
append((signature.symbol as KtNamedSymbol).name.asString())
printCollection(signature.valueParameters, prefix = "(", postfix = ")") { parameter ->
append(parameter.name.asString())
append(": ")
append(parameter.returnType.render())
}
append(": ")
append(signature.returnType.render())
}
is KtVariableLikeSignature -> {
val symbol = signature.symbol
if (symbol is KtVariableSymbol) {
append(if (symbol.isVal) "val" else "var")
append(" ")
}
signature.receiverType?.let { append('.'); append(it.render()) }
append((symbol as KtNamedSymbol).name.asString())
append(": ")
append(signature.returnType.render())
}
}
}
internal fun KtAnalysisSession.compareCalls(call1: KtCall, call2: KtCall): Int {
// The order of candidate calls is non-deterministic. Sort by symbol string value.
if (call1 !is KtCallableMemberCall<*, *> || call2 !is KtCallableMemberCall<*, *>) return 0
@@ -0,0 +1,103 @@
/*
* Copyright 2010-2022 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.
*/
/*
* Copyright 2010-2022 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.cases.scopes
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
import org.jetbrains.kotlin.analysis.api.components.KtDeclarationRendererOptions
import org.jetbrains.kotlin.analysis.api.components.RendererModifier
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.prettyPrintSignature
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.stringRepresentation
import org.jetbrains.kotlin.analysis.api.scopes.KtScope
import org.jetbrains.kotlin.analysis.api.scopes.KtTypeScope
import org.jetbrains.kotlin.analysis.api.symbols.DebugSymbolRenderer
import org.jetbrains.kotlin.analysis.test.framework.base.AbstractAnalysisApiSingleFileTest
import org.jetbrains.kotlin.analysis.test.framework.services.expressionMarkerProvider
import org.jetbrains.kotlin.analysis.utils.printer.prettyPrint
import org.jetbrains.kotlin.psi.KtExpression
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.test.model.TestModule
import org.jetbrains.kotlin.test.services.TestServices
import org.jetbrains.kotlin.test.services.assertions
abstract class AbstractTypeScopeTest : AbstractAnalysisApiSingleFileTest() {
override fun doTestByFileStructure(ktFile: KtFile, module: TestModule, testServices: TestServices) {
val expression = testServices.expressionMarkerProvider.getSelectedElementOfType<KtExpression>(ktFile)
analyseForTest(expression) {
val type = expression.getKtType()
?: error("expression $expression is not typable")
val typeScope = type.getTypeScope()
val declaredScopeByTypeScope = typeScope?.getDeclarationScope()
val scopeStringRepresentation = prettyPrint {
appendLine("expression: ${expression.text}")
appendLine("KtType: ${type.render()}")
appendLine()
appendLine("KtTypeScope:")
appendLine(typeScope?.let { renderForTests(it) } ?: "NO_SCOPE")
appendLine()
appendLine("Declaration Scope:")
appendLine(declaredScopeByTypeScope?.let { renderForTests(it) } ?: "NO_SCOPE")
}
val signaturePretty = prettyPrint {
appendLine("KtTypeScope:")
appendLine(typeScope?.let { prettyPrintForTests(it) } ?: "NO_SCOPE")
appendLine()
appendLine("Declaration Scope:")
appendLine(declaredScopeByTypeScope?.let { prettyPrintForTests(it) } ?: "NO_SCOPE")
}
testServices.assertions.assertEqualsToTestDataFileSibling(scopeStringRepresentation)
testServices.assertions.assertEqualsToTestDataFileSibling(signaturePretty, extension = ".pretty.txt")
}
}
private fun KtAnalysisSession.renderForTests(typeScope: KtTypeScope): String {
val callables = typeScope.getCallableSignatures().toList()
return prettyPrint {
callables.forEach {
appendLine(stringRepresentation(it))
}
}
}
private fun KtAnalysisSession.prettyPrintForTests(typeScope: KtTypeScope): String {
val callables = typeScope.getCallableSignatures().toList()
return prettyPrint {
callables.forEach {
appendLine(prettyPrintSignature(it))
}
}
}
@Suppress("unused")
private fun KtAnalysisSession.renderForTests(scope: KtScope): String {
val callables = scope.getCallableSymbols().toList()
return prettyPrint {
callables.forEach {
appendLine(DebugSymbolRenderer.render(it))
}
}
}
private fun KtAnalysisSession.prettyPrintForTests(scope: KtScope): String {
val callables = scope.getCallableSymbols().toList()
return prettyPrint {
callables.forEach {
appendLine(it.render(options = KtDeclarationRendererOptions.DEFAULT.copy(modifiers = RendererModifier.NONE)))
}
}
}
}
@@ -0,0 +1,84 @@
/*
* 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.standalone.fir.test.cases.generated.cases.scopes;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.analysis.api.standalone.fir.test.AnalysisApiFirStandaloneModeTestConfiguratorFactory;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.scopes.AbstractTypeScopeTest;
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/components/scopeProvider/typeScope")
@TestDataPath("$PROJECT_ROOT")
public class FirStandaloneNormalAnalysisSourceModuleTypeScopeTestGenerated extends AbstractTypeScopeTest {
@NotNull
@Override
public AnalysisApiTestConfigurator getConfigurator() {
return AnalysisApiFirStandaloneModeTestConfiguratorFactory.INSTANCE.createConfigurator(
new AnalysisApiTestConfiguratorFactoryData(
FrontendKind.Fir,
TestModuleKind.Source,
AnalysisSessionMode.Normal,
AnalysisApiMode.Standalone
)
);
}
@Test
public void testAllFilesPresentInTypeScope() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/typeScope"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("errorType.kt")
public void testErrorType() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/errorType.kt");
}
@Test
@TestMetadata("innerClassTypeParamsSubstitution.kt")
public void testInnerClassTypeParamsSubstitution() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/innerClassTypeParamsSubstitution.kt");
}
@Test
@TestMetadata("intList.kt")
public void testIntList() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/intList.kt");
}
@Test
@TestMetadata("outerClassTypeParamsSubstitution.kt")
public void testOuterClassTypeParamsSubstitution() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/outerClassTypeParamsSubstitution.kt");
}
@Test
@TestMetadata("outerTypeParamsSubstitution.kt")
public void testOuterTypeParamsSubstitution() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/outerTypeParamsSubstitution.kt");
}
@Test
@TestMetadata("typeParamList.kt")
public void testTypeParamList() throws Exception {
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/typeParamList.kt");
}
}
@@ -0,0 +1,4 @@
fun foo(o: AAA) {
println(<expr>o</expr>)
}
@@ -0,0 +1,5 @@
KtTypeScope:
NO_SCOPE
Declaration Scope:
NO_SCOPE
@@ -0,0 +1,8 @@
expression: o
KtType: AAA
KtTypeScope:
NO_SCOPE
Declaration Scope:
NO_SCOPE
@@ -0,0 +1,12 @@
class Outer<O> {
inner class A<X> {
fun <Y> foo(x: X, y: Y): Map<X, Map<Y, O>>
val map: Map<X, O>
}
}
fun foo(o: Outer<String>) {
val a = o.A<Int>()
println(<expr>a</expr>)
}
@@ -0,0 +1,15 @@
KtTypeScope:
fun foo(x: kotlin.Int, y: Y): kotlin.collections.Map<kotlin.Int, kotlin.collections.Map<Y, kotlin.String>>
val map: kotlin.collections.Map<kotlin.Int, kotlin.String>
fun equals(other: kotlin.Any?): kotlin.Boolean
fun hashCode(): kotlin.Int
fun toString(): kotlin.String
Declaration Scope:
fun <Y> foo(x: X, y: Y): kotlin.collections.Map<X, kotlin.collections.Map<Y, O>>
val map: kotlin.collections.Map<X, O>
fun equals(other: kotlin.Any?): kotlin.Boolean
fun hashCode(): kotlin.Int
fun toString(): kotlin.String
@@ -0,0 +1,178 @@
expression: a
KtType: Outer<kotlin.String>.A<kotlin.Int>
KtTypeScope:
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.collections.Map<kotlin.Int, kotlin.collections.Map<Y, kotlin.String>>
symbol = /Outer.A.foo(<dispatch receiver>: Outer.A<X, O>, x: X, y: Y): kotlin.collections.Map<X, kotlin.collections.Map<Y, O>>
valueParameters = [
KtVariableLikeSignature:
name = x
receiverType = null
returnType = kotlin.Int
symbol = x: X
callableIdIfNonLocal = null,
KtVariableLikeSignature:
name = y
receiverType = null
returnType = Y
symbol = y: Y
callableIdIfNonLocal = null
]
callableIdIfNonLocal = /Outer.A.foo
KtVariableLikeSignature:
name = map
receiverType = null
returnType = kotlin.collections.Map<kotlin.Int, kotlin.String>
symbol = val map: kotlin.collections.Map<X, O>
callableIdIfNonLocal = /Outer.A.map
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = kotlin/Any.equals(<dispatch receiver>: kotlin.Any, other: kotlin.Any?): kotlin.Boolean
valueParameters = [
KtVariableLikeSignature:
name = other
receiverType = null
returnType = kotlin.Any?
symbol = other: kotlin.Any?
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/Any.equals
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/Any.hashCode(<dispatch receiver>: kotlin.Any): kotlin.Int
valueParameters = []
callableIdIfNonLocal = kotlin/Any.hashCode
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = kotlin/Any.toString(<dispatch receiver>: kotlin.Any): kotlin.String
valueParameters = []
callableIdIfNonLocal = kotlin/Any.toString
Declaration Scope:
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: /Outer.A.foo
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: foo
origin: SOURCE
receiverType: null
returnType: kotlin/collections/Map<X, kotlin/collections/Map<Y, O>>
symbolKind: CLASS_MEMBER
typeParameters: [
KtTypeParameterSymbol(Y)
]
valueParameters: [
KtValueParameterSymbol(x)
KtValueParameterSymbol(y)
]
visibility: Public
KtKotlinPropertySymbol:
annotationsList: []
callableIdIfNonLocal: /Outer.A.map
getter: KtPropertyGetterSymbol(<getter>)
hasBackingField: true
hasGetter: true
hasSetter: false
initializer: null
isConst: false
isDelegatedProperty: false
isExtension: false
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: map
origin: SOURCE
receiverType: null
returnType: kotlin/collections/Map<X, O>
setter: null
symbolKind: CLASS_MEMBER
typeParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.equals
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: true
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: equals
origin: LIBRARY
receiverType: null
returnType: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(other)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.hashCode
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: hashCode
origin: LIBRARY
receiverType: null
returnType: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.toString
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: toString
origin: LIBRARY
receiverType: null
returnType: kotlin/String
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
@@ -0,0 +1,3 @@
fun (list: List<Int>) {
println(<expr>list</expr>)
}
@@ -0,0 +1,33 @@
KtTypeScope:
fun contains(element: kotlin.Int): kotlin.Boolean
fun containsAll(elements: kotlin.collections.Collection<kotlin.Int>): kotlin.Boolean
fun get(index: kotlin.Int): kotlin.Int
fun indexOf(element: kotlin.Int): kotlin.Int
fun isEmpty(): kotlin.Boolean
fun iterator(): kotlin.collections.Iterator<kotlin.Int>
fun lastIndexOf(element: kotlin.Int): kotlin.Int
fun listIterator(): kotlin.collections.ListIterator<kotlin.Int>
fun listIterator(index: kotlin.Int): kotlin.collections.ListIterator<kotlin.Int>
fun subList(fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.collections.List<kotlin.Int>
val size: kotlin.Int
fun equals(other: kotlin.Any?): kotlin.Boolean
fun hashCode(): kotlin.Int
fun toString(): kotlin.String
Declaration Scope:
fun contains(element: E): kotlin.Boolean
fun containsAll(elements: kotlin.collections.Collection<E>): kotlin.Boolean
fun get(index: kotlin.Int): E
fun indexOf(element: E): kotlin.Int
fun isEmpty(): kotlin.Boolean
fun iterator(): kotlin.collections.Iterator<E>
fun lastIndexOf(element: E): kotlin.Int
fun listIterator(): kotlin.collections.ListIterator<E>
fun listIterator(index: kotlin.Int): kotlin.collections.ListIterator<E>
fun subList(fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.collections.List<E>
val size: kotlin.Int
fun equals(other: kotlin.Any?): kotlin.Boolean
fun hashCode(): kotlin.Int
fun toString(): kotlin.String
@@ -0,0 +1,482 @@
expression: list
KtType: kotlin.collections.List<kotlin.Int>
KtTypeScope:
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = kotlin/collections/List.contains(<dispatch receiver>: kotlin.collections.List<E>, element: E): kotlin.Boolean
valueParameters = [
KtVariableLikeSignature:
name = element
receiverType = null
returnType = kotlin.Int
symbol = element: E
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/collections/List.contains
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = kotlin/collections/List.containsAll(<dispatch receiver>: kotlin.collections.List<E>, elements: kotlin.collections.Collection<E>): kotlin.Boolean
valueParameters = [
KtVariableLikeSignature:
name = elements
receiverType = null
returnType = kotlin.collections.Collection<kotlin.Int>
symbol = elements: kotlin.collections.Collection<E>
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/collections/List.containsAll
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/collections/List.get(<dispatch receiver>: kotlin.collections.List<E>, index: kotlin.Int): E
valueParameters = [
KtVariableLikeSignature:
name = index
receiverType = null
returnType = kotlin.Int
symbol = index: kotlin.Int
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/collections/List.get
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/collections/List.indexOf(<dispatch receiver>: kotlin.collections.List<E>, element: E): kotlin.Int
valueParameters = [
KtVariableLikeSignature:
name = element
receiverType = null
returnType = kotlin.Int
symbol = element: E
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/collections/List.indexOf
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = kotlin/collections/List.isEmpty(<dispatch receiver>: kotlin.collections.List<E>): kotlin.Boolean
valueParameters = []
callableIdIfNonLocal = kotlin/collections/List.isEmpty
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.collections.Iterator<kotlin.Int>
symbol = kotlin/collections/List.iterator(<dispatch receiver>: kotlin.collections.List<E>): kotlin.collections.Iterator<E>
valueParameters = []
callableIdIfNonLocal = kotlin/collections/List.iterator
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/collections/List.lastIndexOf(<dispatch receiver>: kotlin.collections.List<E>, element: E): kotlin.Int
valueParameters = [
KtVariableLikeSignature:
name = element
receiverType = null
returnType = kotlin.Int
symbol = element: E
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/collections/List.lastIndexOf
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.collections.ListIterator<kotlin.Int>
symbol = kotlin/collections/List.listIterator(<dispatch receiver>: kotlin.collections.List<E>): kotlin.collections.ListIterator<E>
valueParameters = []
callableIdIfNonLocal = kotlin/collections/List.listIterator
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.collections.ListIterator<kotlin.Int>
symbol = kotlin/collections/List.listIterator(<dispatch receiver>: kotlin.collections.List<E>, index: kotlin.Int): kotlin.collections.ListIterator<E>
valueParameters = [
KtVariableLikeSignature:
name = index
receiverType = null
returnType = kotlin.Int
symbol = index: kotlin.Int
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/collections/List.listIterator
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.collections.List<kotlin.Int>
symbol = kotlin/collections/List.subList(<dispatch receiver>: kotlin.collections.List<E>, fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.collections.List<E>
valueParameters = [
KtVariableLikeSignature:
name = fromIndex
receiverType = null
returnType = kotlin.Int
symbol = fromIndex: kotlin.Int
callableIdIfNonLocal = null,
KtVariableLikeSignature:
name = toIndex
receiverType = null
returnType = kotlin.Int
symbol = toIndex: kotlin.Int
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/collections/List.subList
KtVariableLikeSignature:
name = size
receiverType = null
returnType = kotlin.Int
symbol = val size: kotlin.Int
callableIdIfNonLocal = kotlin/collections/List.size
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = kotlin/Any.equals(<dispatch receiver>: kotlin.Any, other: kotlin.Any?): kotlin.Boolean
valueParameters = [
KtVariableLikeSignature:
name = other
receiverType = null
returnType = kotlin.Any?
symbol = other: kotlin.Any?
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/Any.equals
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/Any.hashCode(<dispatch receiver>: kotlin.Any): kotlin.Int
valueParameters = []
callableIdIfNonLocal = kotlin/Any.hashCode
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = kotlin/Any.toString(<dispatch receiver>: kotlin.Any): kotlin.String
valueParameters = []
callableIdIfNonLocal = kotlin/Any.toString
Declaration Scope:
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.contains
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: true
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: contains
origin: LIBRARY
receiverType: null
returnType: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(element)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.containsAll
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: containsAll
origin: LIBRARY
receiverType: null
returnType: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(elements)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.get
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: true
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: get
origin: LIBRARY
receiverType: null
returnType: E
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(index)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.indexOf
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: indexOf
origin: LIBRARY
receiverType: null
returnType: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(element)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.isEmpty
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: isEmpty
origin: LIBRARY
receiverType: null
returnType: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.iterator
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: true
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: iterator
origin: LIBRARY
receiverType: null
returnType: kotlin/collections/Iterator<E>
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.lastIndexOf
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: lastIndexOf
origin: LIBRARY
receiverType: null
returnType: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(element)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.listIterator
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: listIterator
origin: LIBRARY
receiverType: null
returnType: kotlin/collections/ListIterator<E>
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.listIterator
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: listIterator
origin: LIBRARY
receiverType: null
returnType: kotlin/collections/ListIterator<E>
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(index)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.subList
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: subList
origin: LIBRARY
receiverType: null
returnType: kotlin/collections/List<E>
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(fromIndex)
KtValueParameterSymbol(toIndex)
]
visibility: Public
KtKotlinPropertySymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.size
getter: KtPropertyGetterSymbol(<getter>)
hasBackingField: false
hasGetter: true
hasSetter: false
initializer: null
isConst: false
isDelegatedProperty: false
isExtension: false
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: ABSTRACT
name: size
origin: LIBRARY
receiverType: null
returnType: kotlin/Int
setter: null
symbolKind: CLASS_MEMBER
typeParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.equals
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: true
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: equals
origin: LIBRARY
receiverType: null
returnType: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(other)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.hashCode
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: hashCode
origin: LIBRARY
receiverType: null
returnType: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.toString
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: toString
origin: LIBRARY
receiverType: null
returnType: kotlin/String
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
@@ -0,0 +1,11 @@
class Outer<O> {
class A<X> {
fun <Y> foo(x: X, y: Y): Map<X, Map<Y, O>>
val map: Map<X, O>
}
}
fun foo(a: Outer.A<Int>) {
println(<expr>a</expr>)
}
@@ -0,0 +1,15 @@
KtTypeScope:
fun foo(x: kotlin.Int, y: Y): kotlin.collections.Map<kotlin.Int, kotlin.collections.Map<Y, O>>
val map: kotlin.collections.Map<kotlin.Int, O>
fun equals(other: kotlin.Any?): kotlin.Boolean
fun hashCode(): kotlin.Int
fun toString(): kotlin.String
Declaration Scope:
fun <Y> foo(x: X, y: Y): kotlin.collections.Map<X, kotlin.collections.Map<Y, O>>
val map: kotlin.collections.Map<X, O>
fun equals(other: kotlin.Any?): kotlin.Boolean
fun hashCode(): kotlin.Int
fun toString(): kotlin.String
@@ -0,0 +1,178 @@
expression: a
KtType: Outer.A<kotlin.Int>
KtTypeScope:
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.collections.Map<kotlin.Int, kotlin.collections.Map<Y, O>>
symbol = /Outer.A.foo(<dispatch receiver>: Outer.A<X>, x: X, y: Y): kotlin.collections.Map<X, kotlin.collections.Map<Y, O>>
valueParameters = [
KtVariableLikeSignature:
name = x
receiverType = null
returnType = kotlin.Int
symbol = x: X
callableIdIfNonLocal = null,
KtVariableLikeSignature:
name = y
receiverType = null
returnType = Y
symbol = y: Y
callableIdIfNonLocal = null
]
callableIdIfNonLocal = /Outer.A.foo
KtVariableLikeSignature:
name = map
receiverType = null
returnType = kotlin.collections.Map<kotlin.Int, O>
symbol = val map: kotlin.collections.Map<X, O>
callableIdIfNonLocal = /Outer.A.map
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = kotlin/Any.equals(<dispatch receiver>: kotlin.Any, other: kotlin.Any?): kotlin.Boolean
valueParameters = [
KtVariableLikeSignature:
name = other
receiverType = null
returnType = kotlin.Any?
symbol = other: kotlin.Any?
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/Any.equals
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/Any.hashCode(<dispatch receiver>: kotlin.Any): kotlin.Int
valueParameters = []
callableIdIfNonLocal = kotlin/Any.hashCode
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = kotlin/Any.toString(<dispatch receiver>: kotlin.Any): kotlin.String
valueParameters = []
callableIdIfNonLocal = kotlin/Any.toString
Declaration Scope:
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: /Outer.A.foo
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: foo
origin: SOURCE
receiverType: null
returnType: kotlin/collections/Map<X, kotlin/collections/Map<Y, O>>
symbolKind: CLASS_MEMBER
typeParameters: [
KtTypeParameterSymbol(Y)
]
valueParameters: [
KtValueParameterSymbol(x)
KtValueParameterSymbol(y)
]
visibility: Public
KtKotlinPropertySymbol:
annotationsList: []
callableIdIfNonLocal: /Outer.A.map
getter: KtPropertyGetterSymbol(<getter>)
hasBackingField: true
hasGetter: true
hasSetter: false
initializer: null
isConst: false
isDelegatedProperty: false
isExtension: false
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: map
origin: SOURCE
receiverType: null
returnType: kotlin/collections/Map<X, O>
setter: null
symbolKind: CLASS_MEMBER
typeParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.equals
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: true
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: equals
origin: LIBRARY
receiverType: null
returnType: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(other)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.hashCode
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: hashCode
origin: LIBRARY
receiverType: null
returnType: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.toString
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: toString
origin: LIBRARY
receiverType: null
returnType: kotlin/String
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
@@ -0,0 +1,9 @@
class A<X> {
fun <Y> foo(x: X, y: Y): Map<X, Y>
val map: Map<X, String>
}
fun foo(a: A<Int>) {
println(<expr>a</expr>)
}
@@ -0,0 +1,15 @@
KtTypeScope:
fun foo(x: kotlin.Int, y: Y): kotlin.collections.Map<kotlin.Int, Y>
val map: kotlin.collections.Map<kotlin.Int, kotlin.String>
fun equals(other: kotlin.Any?): kotlin.Boolean
fun hashCode(): kotlin.Int
fun toString(): kotlin.String
Declaration Scope:
fun <Y> foo(x: X, y: Y): kotlin.collections.Map<X, Y>
val map: kotlin.collections.Map<X, kotlin.String>
fun equals(other: kotlin.Any?): kotlin.Boolean
fun hashCode(): kotlin.Int
fun toString(): kotlin.String
@@ -0,0 +1,178 @@
expression: a
KtType: A<kotlin.Int>
KtTypeScope:
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.collections.Map<kotlin.Int, Y>
symbol = /A.foo(<dispatch receiver>: A<X>, x: X, y: Y): kotlin.collections.Map<X, Y>
valueParameters = [
KtVariableLikeSignature:
name = x
receiverType = null
returnType = kotlin.Int
symbol = x: X
callableIdIfNonLocal = null,
KtVariableLikeSignature:
name = y
receiverType = null
returnType = Y
symbol = y: Y
callableIdIfNonLocal = null
]
callableIdIfNonLocal = /A.foo
KtVariableLikeSignature:
name = map
receiverType = null
returnType = kotlin.collections.Map<kotlin.Int, kotlin.String>
symbol = val map: kotlin.collections.Map<X, kotlin.String>
callableIdIfNonLocal = /A.map
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = kotlin/Any.equals(<dispatch receiver>: kotlin.Any, other: kotlin.Any?): kotlin.Boolean
valueParameters = [
KtVariableLikeSignature:
name = other
receiverType = null
returnType = kotlin.Any?
symbol = other: kotlin.Any?
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/Any.equals
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/Any.hashCode(<dispatch receiver>: kotlin.Any): kotlin.Int
valueParameters = []
callableIdIfNonLocal = kotlin/Any.hashCode
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = kotlin/Any.toString(<dispatch receiver>: kotlin.Any): kotlin.String
valueParameters = []
callableIdIfNonLocal = kotlin/Any.toString
Declaration Scope:
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: /A.foo
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: foo
origin: SOURCE
receiverType: null
returnType: kotlin/collections/Map<X, Y>
symbolKind: CLASS_MEMBER
typeParameters: [
KtTypeParameterSymbol(Y)
]
valueParameters: [
KtValueParameterSymbol(x)
KtValueParameterSymbol(y)
]
visibility: Public
KtKotlinPropertySymbol:
annotationsList: []
callableIdIfNonLocal: /A.map
getter: KtPropertyGetterSymbol(<getter>)
hasBackingField: true
hasGetter: true
hasSetter: false
initializer: null
isConst: false
isDelegatedProperty: false
isExtension: false
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: map
origin: SOURCE
receiverType: null
returnType: kotlin/collections/Map<X, kotlin/String>
setter: null
symbolKind: CLASS_MEMBER
typeParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.equals
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: true
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: equals
origin: LIBRARY
receiverType: null
returnType: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(other)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.hashCode
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: hashCode
origin: LIBRARY
receiverType: null
returnType: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.toString
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: toString
origin: LIBRARY
receiverType: null
returnType: kotlin/String
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
@@ -0,0 +1,3 @@
fun <AAA> (list: List<AAA>) {
println(<expr>list</expr>)
}
@@ -0,0 +1,33 @@
KtTypeScope:
fun contains(element: AAA): kotlin.Boolean
fun containsAll(elements: kotlin.collections.Collection<AAA>): kotlin.Boolean
fun get(index: kotlin.Int): AAA
fun indexOf(element: AAA): kotlin.Int
fun isEmpty(): kotlin.Boolean
fun iterator(): kotlin.collections.Iterator<AAA>
fun lastIndexOf(element: AAA): kotlin.Int
fun listIterator(): kotlin.collections.ListIterator<AAA>
fun listIterator(index: kotlin.Int): kotlin.collections.ListIterator<AAA>
fun subList(fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.collections.List<AAA>
val size: kotlin.Int
fun equals(other: kotlin.Any?): kotlin.Boolean
fun hashCode(): kotlin.Int
fun toString(): kotlin.String
Declaration Scope:
fun contains(element: E): kotlin.Boolean
fun containsAll(elements: kotlin.collections.Collection<E>): kotlin.Boolean
fun get(index: kotlin.Int): E
fun indexOf(element: E): kotlin.Int
fun isEmpty(): kotlin.Boolean
fun iterator(): kotlin.collections.Iterator<E>
fun lastIndexOf(element: E): kotlin.Int
fun listIterator(): kotlin.collections.ListIterator<E>
fun listIterator(index: kotlin.Int): kotlin.collections.ListIterator<E>
fun subList(fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.collections.List<E>
val size: kotlin.Int
fun equals(other: kotlin.Any?): kotlin.Boolean
fun hashCode(): kotlin.Int
fun toString(): kotlin.String
@@ -0,0 +1,482 @@
expression: list
KtType: kotlin.collections.List<AAA>
KtTypeScope:
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = kotlin/collections/List.contains(<dispatch receiver>: kotlin.collections.List<E>, element: E): kotlin.Boolean
valueParameters = [
KtVariableLikeSignature:
name = element
receiverType = null
returnType = AAA
symbol = element: E
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/collections/List.contains
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = kotlin/collections/List.containsAll(<dispatch receiver>: kotlin.collections.List<E>, elements: kotlin.collections.Collection<E>): kotlin.Boolean
valueParameters = [
KtVariableLikeSignature:
name = elements
receiverType = null
returnType = kotlin.collections.Collection<AAA>
symbol = elements: kotlin.collections.Collection<E>
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/collections/List.containsAll
KtFunctionLikeSignature:
receiverType = null
returnType = AAA
symbol = kotlin/collections/List.get(<dispatch receiver>: kotlin.collections.List<E>, index: kotlin.Int): E
valueParameters = [
KtVariableLikeSignature:
name = index
receiverType = null
returnType = kotlin.Int
symbol = index: kotlin.Int
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/collections/List.get
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/collections/List.indexOf(<dispatch receiver>: kotlin.collections.List<E>, element: E): kotlin.Int
valueParameters = [
KtVariableLikeSignature:
name = element
receiverType = null
returnType = AAA
symbol = element: E
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/collections/List.indexOf
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = kotlin/collections/List.isEmpty(<dispatch receiver>: kotlin.collections.List<E>): kotlin.Boolean
valueParameters = []
callableIdIfNonLocal = kotlin/collections/List.isEmpty
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.collections.Iterator<AAA>
symbol = kotlin/collections/List.iterator(<dispatch receiver>: kotlin.collections.List<E>): kotlin.collections.Iterator<E>
valueParameters = []
callableIdIfNonLocal = kotlin/collections/List.iterator
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/collections/List.lastIndexOf(<dispatch receiver>: kotlin.collections.List<E>, element: E): kotlin.Int
valueParameters = [
KtVariableLikeSignature:
name = element
receiverType = null
returnType = AAA
symbol = element: E
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/collections/List.lastIndexOf
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.collections.ListIterator<AAA>
symbol = kotlin/collections/List.listIterator(<dispatch receiver>: kotlin.collections.List<E>): kotlin.collections.ListIterator<E>
valueParameters = []
callableIdIfNonLocal = kotlin/collections/List.listIterator
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.collections.ListIterator<AAA>
symbol = kotlin/collections/List.listIterator(<dispatch receiver>: kotlin.collections.List<E>, index: kotlin.Int): kotlin.collections.ListIterator<E>
valueParameters = [
KtVariableLikeSignature:
name = index
receiverType = null
returnType = kotlin.Int
symbol = index: kotlin.Int
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/collections/List.listIterator
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.collections.List<AAA>
symbol = kotlin/collections/List.subList(<dispatch receiver>: kotlin.collections.List<E>, fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.collections.List<E>
valueParameters = [
KtVariableLikeSignature:
name = fromIndex
receiverType = null
returnType = kotlin.Int
symbol = fromIndex: kotlin.Int
callableIdIfNonLocal = null,
KtVariableLikeSignature:
name = toIndex
receiverType = null
returnType = kotlin.Int
symbol = toIndex: kotlin.Int
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/collections/List.subList
KtVariableLikeSignature:
name = size
receiverType = null
returnType = kotlin.Int
symbol = val size: kotlin.Int
callableIdIfNonLocal = kotlin/collections/List.size
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = kotlin/Any.equals(<dispatch receiver>: kotlin.Any, other: kotlin.Any?): kotlin.Boolean
valueParameters = [
KtVariableLikeSignature:
name = other
receiverType = null
returnType = kotlin.Any?
symbol = other: kotlin.Any?
callableIdIfNonLocal = null
]
callableIdIfNonLocal = kotlin/Any.equals
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/Any.hashCode(<dispatch receiver>: kotlin.Any): kotlin.Int
valueParameters = []
callableIdIfNonLocal = kotlin/Any.hashCode
KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = kotlin/Any.toString(<dispatch receiver>: kotlin.Any): kotlin.String
valueParameters = []
callableIdIfNonLocal = kotlin/Any.toString
Declaration Scope:
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.contains
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: true
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: contains
origin: LIBRARY
receiverType: null
returnType: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(element)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.containsAll
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: containsAll
origin: LIBRARY
receiverType: null
returnType: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(elements)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.get
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: true
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: get
origin: LIBRARY
receiverType: null
returnType: E
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(index)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.indexOf
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: indexOf
origin: LIBRARY
receiverType: null
returnType: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(element)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.isEmpty
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: isEmpty
origin: LIBRARY
receiverType: null
returnType: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.iterator
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: true
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: iterator
origin: LIBRARY
receiverType: null
returnType: kotlin/collections/Iterator<E>
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.lastIndexOf
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: lastIndexOf
origin: LIBRARY
receiverType: null
returnType: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(element)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.listIterator
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: listIterator
origin: LIBRARY
receiverType: null
returnType: kotlin/collections/ListIterator<E>
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.listIterator
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: listIterator
origin: LIBRARY
receiverType: null
returnType: kotlin/collections/ListIterator<E>
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(index)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.subList
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: ABSTRACT
name: subList
origin: LIBRARY
receiverType: null
returnType: kotlin/collections/List<E>
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(fromIndex)
KtValueParameterSymbol(toIndex)
]
visibility: Public
KtKotlinPropertySymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/collections/List.size
getter: KtPropertyGetterSymbol(<getter>)
hasBackingField: false
hasGetter: true
hasSetter: false
initializer: null
isConst: false
isDelegatedProperty: false
isExtension: false
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: ABSTRACT
name: size
origin: LIBRARY
receiverType: null
returnType: kotlin/Int
setter: null
symbolKind: CLASS_MEMBER
typeParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.equals
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: true
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: equals
origin: LIBRARY
receiverType: null
returnType: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol(other)
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.hashCode
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: hashCode
origin: LIBRARY
receiverType: null
returnType: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.toString
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: toString
origin: LIBRARY
receiverType: null
returnType: kotlin/String
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
@@ -17,6 +17,7 @@ import org.jetbrains.kotlin.test.model.TestFile
import org.jetbrains.kotlin.test.services.SourceFilePreprocessor
import org.jetbrains.kotlin.test.services.TestService
import org.jetbrains.kotlin.test.services.TestServices
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance
internal class ExpressionMarkersSourceFilePreprocessor(testServices: TestServices) : SourceFilePreprocessor(testServices) {
override fun process(file: TestFile, content: String): String {
@@ -102,6 +103,15 @@ class ExpressionMarkerProvider : TestService {
return elements.single() as KtElement
}
inline fun <reified E : KtElement> getSelectedElementOfType(file: KtFile): E {
return when (val selected = getSelectedElement(file)) {
is E -> selected
else -> generateSequence(selected as PsiElement) { current ->
current.children.singleOrNull()?.takeIf { it.textRange == current.textRange }
}.firstIsInstance()
}
}
private fun List<PsiElement>.trimWhitespaces(): List<PsiElement> =
dropWhile { it is PsiWhiteSpace }
.dropLastWhile { it is PsiWhiteSpace }
@@ -35,10 +35,7 @@ import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.typeInf
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.typeProvider.AbstractAnalysisApiGetSuperTypesTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.typeProvider.AbstractHasCommonSubtypeTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.references.AbstractReferenceResolveTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.scopes.AbstractDelegateMemberScopeTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.scopes.AbstractFileScopeTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.scopes.AbstractMemberScopeByFqNameTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.scopes.AbstractSubstitutionOverridesUnwrappingTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.scopes.*
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.AbstractSymbolByFqNameTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.AbstractSymbolByPsiTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.AbstractSymbolByReferenceTest
@@ -289,4 +286,12 @@ private fun AnalysisApiTestGroup.generateAnalysisApiComponentsTests() {
}
}
}
component("scopeProvider") {
group(filter = frontendIs(FrontendKind.Fir)) {
test(AbstractTypeScopeTest::class) {
model("typeScope")
}
}
}
}