FIR: Support loading deserialized declarations from JVM class files
This commit is contained in:
@@ -8,10 +8,19 @@ package org.jetbrains.kotlin.fir.java
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import org.jetbrains.kotlin.analyzer.ModuleInfo
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
||||
import org.jetbrains.kotlin.fir.*
|
||||
import org.jetbrains.kotlin.fir.java.deserialization.KotlinDeserializedJvmSymbolsProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.FirProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.FirSymbolProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.impl.*
|
||||
import org.jetbrains.kotlin.fir.resolve.impl.FirCompositeSymbolProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.impl.FirDependenciesSymbolProviderImpl
|
||||
import org.jetbrains.kotlin.fir.resolve.impl.FirLibrarySymbolProviderImpl
|
||||
import org.jetbrains.kotlin.load.java.JavaClassFinder
|
||||
import org.jetbrains.kotlin.load.java.JavaClassFinderImpl
|
||||
import org.jetbrains.kotlin.load.kotlin.KotlinClassFinder
|
||||
import org.jetbrains.kotlin.load.kotlin.PackagePartProvider
|
||||
import org.jetbrains.kotlin.load.kotlin.VirtualFileFinderFactory
|
||||
|
||||
class FirJavaModuleBasedSession(
|
||||
moduleInfo: ModuleInfo,
|
||||
@@ -34,10 +43,13 @@ class FirJavaModuleBasedSession(
|
||||
}
|
||||
}
|
||||
|
||||
class FirLibrarySession(
|
||||
class FirLibrarySession private constructor(
|
||||
moduleInfo: ModuleInfo,
|
||||
override val sessionProvider: FirProjectSessionProvider,
|
||||
scope: GlobalSearchScope
|
||||
scope: GlobalSearchScope,
|
||||
packagePartProvider: PackagePartProvider,
|
||||
kotlinClassFinder: KotlinClassFinder,
|
||||
javaClassFinder: JavaClassFinder
|
||||
) : FirSessionBase() {
|
||||
init {
|
||||
sessionProvider.sessionCache[moduleInfo] = this
|
||||
@@ -45,6 +57,11 @@ class FirLibrarySession(
|
||||
FirSymbolProvider::class,
|
||||
FirCompositeSymbolProvider(
|
||||
listOf(
|
||||
KotlinDeserializedJvmSymbolsProvider(
|
||||
this, sessionProvider.project,
|
||||
packagePartProvider, kotlinClassFinder,
|
||||
javaClassFinder
|
||||
),
|
||||
FirLibrarySymbolProviderImpl(this),
|
||||
JavaSymbolProvider(this, sessionProvider.project, scope),
|
||||
FirDependenciesSymbolProviderImpl(this)
|
||||
@@ -52,6 +69,38 @@ class FirLibrarySession(
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun create(
|
||||
moduleInfo: ModuleInfo,
|
||||
sessionProvider: FirProjectSessionProvider,
|
||||
scope: GlobalSearchScope,
|
||||
environment: KotlinCoreEnvironment
|
||||
): FirLibrarySession = create(
|
||||
moduleInfo, sessionProvider, scope, environment.project,
|
||||
environment.createPackagePartProvider(scope)
|
||||
)
|
||||
|
||||
fun create(
|
||||
moduleInfo: ModuleInfo,
|
||||
sessionProvider: FirProjectSessionProvider,
|
||||
scope: GlobalSearchScope,
|
||||
project: Project,
|
||||
packagePartProvider: PackagePartProvider
|
||||
): FirLibrarySession {
|
||||
val javaClassFinder = JavaClassFinderImpl().apply {
|
||||
this.setProjectInstance(project)
|
||||
this.setScope(scope)
|
||||
}
|
||||
|
||||
return FirLibrarySession(
|
||||
moduleInfo, sessionProvider, scope,
|
||||
packagePartProvider,
|
||||
VirtualFileFinderFactory.getInstance(project).create(scope),
|
||||
javaClassFinder
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class FirProjectSessionProvider(val project: Project) : FirSessionProvider {
|
||||
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. 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.fir.java.deserialization
|
||||
|
||||
import com.intellij.openapi.project.Project
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.declarations.FirCallableMemberDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.FirNamedDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.FirRegularClass
|
||||
import org.jetbrains.kotlin.fir.deserialization.FirDeserializationContext
|
||||
import org.jetbrains.kotlin.fir.deserialization.deserializeClassToSymbol
|
||||
import org.jetbrains.kotlin.fir.resolve.AbstractFirSymbolProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.getOrPut
|
||||
import org.jetbrains.kotlin.fir.symbols.CallableId
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeCallableSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
|
||||
import org.jetbrains.kotlin.load.java.JavaClassFinder
|
||||
import org.jetbrains.kotlin.load.java.structure.JavaClass
|
||||
import org.jetbrains.kotlin.load.kotlin.KotlinClassFinder
|
||||
import org.jetbrains.kotlin.load.kotlin.PackagePartProvider
|
||||
import org.jetbrains.kotlin.load.kotlin.findKotlinClass
|
||||
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
|
||||
import org.jetbrains.kotlin.metadata.ProtoBuf
|
||||
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
|
||||
import org.jetbrains.kotlin.serialization.deserialization.getName
|
||||
|
||||
class KotlinDeserializedJvmSymbolsProvider(
|
||||
val session: FirSession,
|
||||
val project: Project,
|
||||
private val packagePartProvider: PackagePartProvider,
|
||||
private val kotlinClassFinder: KotlinClassFinder,
|
||||
private val javaClassFinder: JavaClassFinder
|
||||
) : AbstractFirSymbolProvider() {
|
||||
|
||||
private val classesCache = mutableMapOf<ClassId, FirClassSymbol>()
|
||||
private val packagePartsCache = mutableMapOf<FqName, Collection<Pair<ProtoBuf.Package, FirDeserializationContext>>>()
|
||||
|
||||
private fun computePackagePartsInfos(packageFqName: FqName): List<Pair<ProtoBuf.Package, FirDeserializationContext>> {
|
||||
return packagePartProvider.findPackageParts(packageFqName.asString()).mapNotNull { partName ->
|
||||
val classId = ClassId.topLevel(JvmClassName.byInternalName(partName).fqNameForTopLevelClassMaybeWithDollars)
|
||||
val kotlinJvmBinaryClass = kotlinClassFinder.findKotlinClass(classId) ?: return@mapNotNull null
|
||||
|
||||
val data = kotlinJvmBinaryClass.classHeader.data ?: return@mapNotNull null
|
||||
val strings = kotlinJvmBinaryClass.classHeader.strings ?: return@mapNotNull null
|
||||
val (nameResolver, packageProto) = JvmProtoBufUtil.readPackageDataFrom(data, strings)
|
||||
|
||||
packageProto to FirDeserializationContext.createForPackage(packageFqName, packageProto, nameResolver, session)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getClassLikeSymbolByFqName(classId: ClassId): ConeClassLikeSymbol? {
|
||||
return findAndDeserializeClass(classId)
|
||||
}
|
||||
|
||||
private fun findAndDeserializeClass(
|
||||
classId: ClassId,
|
||||
parentContext: FirDeserializationContext? = null
|
||||
): FirClassSymbol? {
|
||||
val kotlinJvmBinaryClass = kotlinClassFinder.findKotlinClass(classId) ?: return null
|
||||
if (kotlinJvmBinaryClass.classHeader.kind != KotlinClassHeader.Kind.CLASS) return null
|
||||
|
||||
val data = kotlinJvmBinaryClass.classHeader.data ?: return null
|
||||
val strings = kotlinJvmBinaryClass.classHeader.strings ?: return null
|
||||
val (nameResolver, classProto) = JvmProtoBufUtil.readClassDataFrom(data, strings)
|
||||
|
||||
return classesCache.getOrPut(classId, { FirClassSymbol(classId) }) { symbol ->
|
||||
deserializeClassToSymbol(
|
||||
classId, classProto, symbol, nameResolver, session, parentContext,
|
||||
this::findAndDeserializeClass
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getCallableSymbols(callableId: CallableId): List<ConeCallableSymbol> {
|
||||
if (callableId.classId != null) {
|
||||
return getClassDeclarations(callableId.classId!!).filterIsInstance<FirCallableMemberDeclaration>()
|
||||
.filter { it.name == callableId.callableName }
|
||||
.map { it.symbol }
|
||||
}
|
||||
|
||||
val packageFqName = callableId.packageName
|
||||
|
||||
return getPackageParts(packageFqName).flatMap { (packageProto, context) ->
|
||||
packageProto.functionList.map {
|
||||
context.memberDeserializer.loadFunction(it).symbol
|
||||
}.filter { callableSymbol -> callableSymbol.callableId.callableName == callableId.callableName }
|
||||
}
|
||||
}
|
||||
|
||||
private fun getPackageParts(packageFqName: FqName): Collection<Pair<ProtoBuf.Package, FirDeserializationContext>> {
|
||||
return packagePartsCache.getOrPut(packageFqName) {
|
||||
computePackagePartsInfos(packageFqName)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getAllCallableNamesInPackage(fqName: FqName): Set<Name> {
|
||||
return getPackageParts(fqName).flatMapTo(mutableSetOf()) { (packageProto, context) ->
|
||||
packageProto.functionList.map { context.nameResolver.getName(it.name) }
|
||||
}
|
||||
}
|
||||
|
||||
override fun getClassNamesInPackage(fqName: FqName): Set<Name> =
|
||||
javaClassFinder.findPackage(fqName)
|
||||
?.getClasses { true }.orEmpty()
|
||||
.mapTo(sortedSetOf(), JavaClass::name)
|
||||
|
||||
private fun getClassDeclarations(classId: ClassId): List<FirDeclaration> {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val classSymbol = getClassLikeSymbolByFqName(classId) as? FirBasedSymbol<FirRegularClass> ?: return emptyList()
|
||||
return classSymbol.fir.declarations
|
||||
}
|
||||
|
||||
override fun getAllCallableNamesInClass(classId: ClassId): Set<Name> =
|
||||
getClassDeclarations(classId)
|
||||
.filterIsInstance<FirNamedDeclaration>()
|
||||
.mapTo(mutableSetOf(), FirNamedDeclaration::name)
|
||||
|
||||
override fun getNestedClassesNamesInClass(classId: ClassId): Set<Name> {
|
||||
return getClassDeclarations(classId).filterIsInstance<FirRegularClass>().mapTo(mutableSetOf()) { it.name }
|
||||
}
|
||||
|
||||
override fun getPackage(fqName: FqName): FqName? = null
|
||||
}
|
||||
@@ -13,6 +13,7 @@ dependencies {
|
||||
compile(project(":core:deserialization"))
|
||||
compile(project(":compiler:fir:cones"))
|
||||
compile(project(":compiler:fir:tree"))
|
||||
compile(project(":compiler:cli"))
|
||||
|
||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ class FirLibrarySymbolProviderImpl(val session: FirSession) : FirSymbolProvider
|
||||
val classDataFinder = ProtoBasedClassDataFinder(packageProto, nameResolver, version) { SourceElement.NO_SOURCE }
|
||||
|
||||
private val memberDeserializer by lazy {
|
||||
FirDeserializationContext.createForPackage(fqName, packageProto, nameResolver, session).memberDeserializer
|
||||
FirDeserializationContext.createForPackage(fqName, packageProto.`package`, nameResolver, session).memberDeserializer
|
||||
}
|
||||
|
||||
val lookup = mutableMapOf<ClassId, FirClassSymbol>()
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
public final annotation class AnnotatedAnnotation : R|kotlin/Annotation| {
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
public open class AnnotatedMethod : R|kotlin/Any| {
|
||||
public open fun f(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
public final class AnnotationInAnnotationArguments : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public final enum class E : R|kotlin/Enum<test/E>| {
|
||||
}
|
||||
|
||||
public final annotation class EnumOption : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class OptionGroups : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class StringOptions : R|kotlin/Annotation| {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Klass : R|kotlin/Any| {
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
public final enum class E : R|kotlin/Enum<test/E>| {
|
||||
}
|
||||
|
||||
public final annotation class EnumAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class EnumArgumentWithCustomToString : R|kotlin/Any| {
|
||||
public final fun annotated(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
public final annotation class EnumArrayAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public abstract interface T : R|kotlin/Any| {
|
||||
public abstract fun foo(): R|kotlin/Array<kotlin/Array<kotlin/Array<test/T>>>|
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Klass : R|kotlin/Any| {
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
public final annotation class SimpleAnnotation : R|kotlin/Annotation| {
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
public final annotation class TargetedAnnotation : R|kotlin/Annotation| {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Constructor : R|kotlin/Any| {
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final fun foo(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class Bnno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final enum class Eee : R|kotlin/Enum<test/Eee>| {
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final fun foo(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
public final annotation class Ann : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public sealed class Sealed : R|kotlin/Any| {
|
||||
public final class Derived : R|test/Sealed| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final class Test : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public final inline class Z : R|kotlin/Any| {
|
||||
public open operator fun equals(other: R|kotlin/Any|): R|kotlin/Boolean|
|
||||
|
||||
public open fun hashCode(): R|kotlin/Int|
|
||||
|
||||
public open fun toString(): R|kotlin/String|
|
||||
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public final inline class Z : R|kotlin/Any| {
|
||||
public open operator fun equals(other: R|kotlin/Any|): R|kotlin/Boolean|
|
||||
|
||||
public open fun hashCode(): R|kotlin/Int|
|
||||
|
||||
public open fun toString(): R|kotlin/String|
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
}
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
public final class A : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
public final annotation class Anno1 : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class B : R|kotlin/Any| {
|
||||
public final annotation class Anno2 : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final class C : R|kotlin/Any| {
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
public final class Nested : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public final class A : R|kotlin/Any| {
|
||||
public final class B : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
public final data class My : R|kotlin/Any| {
|
||||
public final operator fun component1(): R|kotlin/Int|
|
||||
|
||||
public final fun copy(x: R|kotlin/Int|): R|test/My|
|
||||
|
||||
public open operator fun equals(other: R|kotlin/Any|): R|kotlin/Boolean|
|
||||
|
||||
public open fun hashCode(): R|kotlin/Int|
|
||||
|
||||
public open fun toString(): R|kotlin/String|
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public final inner class Inner : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public final class Nested : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
public final annotation class $$$$$$ : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class A : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public final annotation class Anno$tation : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Cla$s : R|kotlin/Any| {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public final inner class Inner : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public final class Nested : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
public final annotation class A1 : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class A2 : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class A3 : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
public final class A : R|kotlin/Any| {
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final class B : R|kotlin/Any| {
|
||||
public final fun f(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final inner class Inner : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public final class Nested : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class X : R|kotlin/Any| {
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
public final annotation class BooleanAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class ByteAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class CharAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public final annotation class DoubleAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class FloatAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class IntAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class LongAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class ShortAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
}
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
public final fun foo(): R|kotlin/Unit|
|
||||
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
public final fun baz(): R|kotlin/Unit|
|
||||
|
||||
public final fun foo(): R|kotlin/Unit|
|
||||
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
public final fun function(): R|kotlin/Unit|
|
||||
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
public final fun baz(): R|kotlin/Unit|
|
||||
|
||||
public final fun foo(): R|kotlin/Unit|
|
||||
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class B : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class B : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final enum class E : R|kotlin/Enum<test/E>| {
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
public final fun R|kotlin/Int|.foo(x: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
compiler/fir/resolve/testData/loadCompiledKotlin/annotations/parameters/ExtensionFunctionInClass.txt
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final fun R|kotlin/String|.foo(x: R|kotlin/Int|): R|kotlin/Int|
|
||||
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final fun foo(x: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public abstract interface Trait : R|kotlin/Any| {
|
||||
public open fun foo(x: R|kotlin/String|): R|kotlin/Int|
|
||||
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Outer : R|kotlin/Any| {
|
||||
public final inner class Inner : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public final class Nested : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
public final fun bar(x: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
public final fun foo(x: R|kotlin/Int|, y: R|kotlin/Double|, z: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class B : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class C : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class D : R|kotlin/Annotation| {
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
public final fun foo(x: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class B : R|kotlin/Annotation| {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
public final class Class : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public final annotation class DoubleAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class IntAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class StringAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public final annotation class DoubleAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class IntAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class StringAnno : R|kotlin/Annotation| {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public abstract interface Trait : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public abstract interface Trait : R|kotlin/Any| {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public abstract interface Trait : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
public final class A : R|kotlin/Any| {
|
||||
public final fun arrays(s: R|kotlin/Array<kotlin/Int>|, t: R|kotlin/Array<kotlin/IntArray>|, u: R|kotlin/Array<kotlin/Array<kotlin/Int>>|, v: R|kotlin/Array<kotlin/Array<kotlin/Array<kotlin/String>>>|): R|kotlin/Unit|
|
||||
|
||||
public final fun generic(s: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
public final fun innerGeneric(s: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
public final fun simple(s: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
public final annotation class Ann : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
<T> public final class Generic : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
<A, B> public final class InnerGeneric : R|kotlin/Any| {
|
||||
<C, D> public final inner class Inner : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final class Simple : R|kotlin/Any| {
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
public final fun R|kotlin/String|.foo(): R|kotlin/Unit|
|
||||
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class SimpleTypeAnnotation : R|kotlin/Any| {
|
||||
public final fun foo(x: R|kotlin/ranges/IntRange|): R|kotlin/Int|
|
||||
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
public final fun typeAnnotation(): R|kotlin/Unit|
|
||||
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class TypeParameterAnnotation : R|kotlin/Any| {
|
||||
<T> public final fun foo(x: R|T|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
<T> public abstract interface Foo : R|java/io/Serializable| {
|
||||
<E, F> public abstract fun bar(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
public final annotation class Ann : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class TypeAnnotationWithArguments : R|kotlin/Any| {
|
||||
public final fun foo(param: R|kotlin/ranges/IntRange|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
public final fun foo(bar: R|kotlin/collections/Map<kotlin/String, kotlin/collections/List<kotlin/Int>>|): R|kotlin/Unit|
|
||||
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class SimpleTypeParameterAnnotation : R|kotlin/Any| {
|
||||
<T> public final fun foo(x: R|T|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class SimpleTypeParameterAnnotation : R|kotlin/Any| {
|
||||
<T> public final fun foo(x: R|T|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public final class CustomDelegate : R|kotlin/Any| {
|
||||
public final operator fun getValue(thisRef: R|kotlin/Any|, prop: R|kotlin/reflect/KProperty<*>|): R|kotlin/String|
|
||||
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final annotation class B : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public abstract interface I : R|kotlin/Any| {
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
public final class A : R|kotlin/Any| {
|
||||
public final fun R|kotlin/String|.myLength(q: R|kotlin/String|): R|kotlin/Int|
|
||||
|
||||
}
|
||||
|
||||
public final annotation class Ann : R|kotlin/Annotation| {
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
public final class Ramification : R|kotlin/Any| {
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<T> public final class Wine : R|kotlin/Any| {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public final class Outer : R|kotlin/Any| {
|
||||
public final inner class Inner : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<test> public final class ConstructorTypeParamClassObjectConflict : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<test> public final class ConstructorTypeParamClassObjectTypeConflict : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
public abstract interface test : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final class TestClassObjectAndClassConflict : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final class TestConstructorParamClassObjectConflict : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final class TestConstructorValClassObjectConflict : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<T> public final class Juice : R|kotlin/Any| {
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<T> public final class Beer : R|kotlin/Any| {
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
<A, B> public final class ClassParamReferencesParam : R|kotlin/Any| {
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
<A, B> public final class ClassParamReferencesParam : R|kotlin/Any| {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<A> public final class ClassParamReferencesSelf : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
<P> public abstract interface TraitWithP : R|kotlin/Any| {
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
<A> public final class Clock : R|kotlin/Any| {
|
||||
}
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
<A> public final class Clock : R|kotlin/Any| {
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
<A> public final class Clock : R|kotlin/Any| {
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<P, Q> public final class ClassTwoParams : R|kotlin/Any| {
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<P, Q> public final class ClassTwoParams : R|kotlin/Any| {
|
||||
}
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
public final enum class EnumWithGenericConstructorParameter : R|kotlin/Enum<test/EnumWithGenericConstructorParameter>| {
|
||||
}
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
public final enum class EnumWithPrimitiveConstructorParameter : R|kotlin/Enum<test/EnumWithPrimitiveConstructorParameter>| {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public abstract class Aaa : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public final class Bbb : R|test/Aaa| {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<P> public abstract class Aaa : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public final class Bbb : R|test/Aaa<java/util/Random>| {
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<T> public abstract interface A : R|kotlin/Any| {
|
||||
public abstract fun bar(): R|T|
|
||||
|
||||
public open fun foo(): R|T|
|
||||
|
||||
}
|
||||
|
||||
public final class B : R|test/A<kotlin/String>| {
|
||||
public open fun bar(): R|kotlin/String|
|
||||
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public open class Class : R|test/Trait| {
|
||||
}
|
||||
|
||||
public abstract interface Trait : R|kotlin/Any| {
|
||||
public open fun f(a: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user