FIR: introduce symbols + type parameter resolve #KT-24064 Fixed
This commit is contained in:
@@ -5,10 +5,10 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.descriptors
|
||||
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.types.ConeKotlinType
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
|
||||
|
||||
interface ConeDescriptor
|
||||
|
||||
interface ConeClassifierDescriptor : ConeDescriptor
|
||||
@@ -16,10 +16,12 @@ interface ConeClassifierDescriptor : ConeDescriptor
|
||||
interface ConeClassifierDescriptorWithTypeParameters : ConeClassifierDescriptor {
|
||||
val typeParameters: List<ConeTypeParameterDescriptor>
|
||||
|
||||
val fqName: ClassId
|
||||
val classId: ClassId
|
||||
}
|
||||
|
||||
interface ConeTypeParameterDescriptor : ConeClassifierDescriptor
|
||||
interface ConeTypeParameterDescriptor : ConeClassifierDescriptor {
|
||||
val symbol: ConeTypeParameterSymbol
|
||||
}
|
||||
|
||||
interface ConeTypeAliasDescriptor : ConeClassifierDescriptorWithTypeParameters {
|
||||
val expandedType: ConeKotlinType
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright 2010-2018 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.symbols
|
||||
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
|
||||
interface ConeSymbol
|
||||
|
||||
interface ConeTypeParameterSymbol : ConeSymbol
|
||||
|
||||
class ConeClassLikeSymbol(val classId: ClassId) : ConeSymbol
|
||||
|
||||
fun ClassId.toSymbol() = ConeClassLikeSymbol(this)
|
||||
+18
-8
@@ -5,7 +5,9 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.types
|
||||
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterSymbol
|
||||
|
||||
sealed class ConeKotlinTypeProjection(val kind: ProjectionKind)
|
||||
|
||||
@@ -24,16 +26,24 @@ abstract class ConeKotlinTypeProjectionOut : ConeKotlinTypeProjection(Projection
|
||||
abstract val type: ConeKotlinType
|
||||
}
|
||||
|
||||
abstract class ConeKotlinType : ConeKotlinTypeProjection(ProjectionKind.INVARIANT) {
|
||||
abstract class ConeKotlinType : ConeKotlinTypeProjection(ProjectionKind.INVARIANT)
|
||||
|
||||
abstract class ConeSymbolBasedType : ConeKotlinType() {
|
||||
abstract val symbol: ConeSymbol
|
||||
}
|
||||
|
||||
abstract class ConeClassLikeType : ConeSymbolBasedType() {
|
||||
abstract override val symbol: ConeClassLikeSymbol
|
||||
|
||||
abstract val typeArguments: List<ConeKotlinTypeProjection>
|
||||
}
|
||||
|
||||
abstract class ConeClassType : ConeKotlinType() {
|
||||
abstract val fqName: ClassId
|
||||
abstract class ConeAbbreviatedType : ConeClassLikeType() {
|
||||
abstract val abbreviationSymbol: ConeClassLikeSymbol
|
||||
|
||||
abstract val directExpansion: ConeClassLikeType
|
||||
}
|
||||
|
||||
abstract class ConeAbbreviatedType : ConeClassType() {
|
||||
abstract val abbreviationFqName: ClassId
|
||||
|
||||
abstract val directExpansion: ConeKotlinType
|
||||
abstract class ConeTypeParameterType : ConeSymbolBasedType() {
|
||||
abstract override val symbol: ConeTypeParameterSymbol
|
||||
}
|
||||
@@ -5,21 +5,20 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.types.impl
|
||||
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
|
||||
open class ConeClassTypeImpl(
|
||||
override val fqName: ClassId,
|
||||
override val symbol: ConeClassLikeSymbol,
|
||||
override val typeArguments: List<ConeKotlinTypeProjection>
|
||||
) : ConeClassType()
|
||||
) : ConeClassLikeType()
|
||||
|
||||
class ConeKotlinTypeProjectionInImpl(override val type: ConeKotlinType) : ConeKotlinTypeProjectionIn()
|
||||
|
||||
class ConeKotlinTypeProjectionOutImpl(override val type: ConeKotlinType) : ConeKotlinTypeProjectionOut()
|
||||
|
||||
class ConeKotlinErrorType(val reason: String) : ConeKotlinType() {
|
||||
override val typeArguments: List<ConeKotlinTypeProjection>
|
||||
get() = emptyList()
|
||||
|
||||
override fun toString(): String {
|
||||
return "<ERROR TYPE: $reason>"
|
||||
@@ -27,10 +26,12 @@ class ConeKotlinErrorType(val reason: String) : ConeKotlinType() {
|
||||
}
|
||||
|
||||
class ConeAbbreviatedTypeImpl(
|
||||
override val abbreviationFqName: ClassId,
|
||||
override val abbreviationSymbol: ConeClassLikeSymbol,
|
||||
override val typeArguments: List<ConeKotlinTypeProjection>,
|
||||
override val directExpansion: ConeKotlinType
|
||||
override val directExpansion: ConeClassLikeType
|
||||
) : ConeAbbreviatedType() {
|
||||
override val fqName: ClassId
|
||||
get() = abbreviationFqName
|
||||
}
|
||||
override val symbol: ConeClassLikeSymbol
|
||||
get() = abbreviationSymbol
|
||||
}
|
||||
|
||||
class ConeTypeParameterTypeImpl(override val symbol: ConeTypeParameterSymbol) : ConeTypeParameterType()
|
||||
@@ -17,6 +17,7 @@ import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirBody
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.impl.*
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.types.FirType
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeProjection
|
||||
import org.jetbrains.kotlin.fir.types.impl.*
|
||||
@@ -274,6 +275,7 @@ class RawFirBuilder(val session: FirSession) {
|
||||
typeAlias.getTypeReference().toFirOrErrorType()
|
||||
)
|
||||
typeAlias.extractAnnotationsTo(firTypeAlias)
|
||||
typeAlias.extractTypeParametersTo(firTypeAlias)
|
||||
return firTypeAlias
|
||||
}
|
||||
|
||||
@@ -433,7 +435,9 @@ class RawFirBuilder(val session: FirSession) {
|
||||
session,
|
||||
parameter,
|
||||
parameter.nameAsSafeName,
|
||||
parameter.variance
|
||||
parameter.variance,
|
||||
parameter.hasModifier(KtTokens.REIFIED_KEYWORD),
|
||||
FirTypeParameterSymbol()
|
||||
)
|
||||
parameter.extractAnnotationsTo(firTypeParameter)
|
||||
val extendsBound = parameter.extendsBound
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import org.jetbrains.kotlin.name.ClassId
|
||||
|
||||
class ConeClassDescriptorImpl(
|
||||
override val typeParameters: List<ConeTypeParameterDescriptor>,
|
||||
override val fqName: ClassId,
|
||||
override val classId: ClassId,
|
||||
override val superTypes: List<ConeKotlinType>,
|
||||
override val nestedClassifiers: List<ConeClassifierDescriptor>
|
||||
) : ConeClassDescriptor, AbstractFirBasedDescriptor<FirResolvedClass>()
|
||||
+1
-1
@@ -13,6 +13,6 @@ import org.jetbrains.kotlin.name.ClassId
|
||||
|
||||
class ConeTypeAliasDescriptorImpl(
|
||||
override val typeParameters: List<ConeTypeParameterDescriptor>,
|
||||
override val fqName: ClassId,
|
||||
override val classId: ClassId,
|
||||
override val expandedType: ConeKotlinType
|
||||
) : ConeTypeAliasDescriptor, AbstractFirBasedDescriptor<FirResolvedTypeAlias>()
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright 2010-2018 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.descriptors
|
||||
|
||||
import org.jetbrains.kotlin.fir.declarations.FirResolvedTypeParameter
|
||||
import org.jetbrains.kotlin.fir.descriptors.ConeTypeParameterDescriptor
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
class ConeTypeParameterDescriptorImpl(
|
||||
override val symbol: ConeTypeParameterSymbol
|
||||
) : ConeTypeParameterDescriptor, AbstractFirBasedDescriptor<FirResolvedTypeParameter>()
|
||||
+38
-5
@@ -10,14 +10,18 @@ import org.jetbrains.kotlin.fir.FirElement
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedClassImpl
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedTypeAliasImpl
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedTypeParameterImpl
|
||||
import org.jetbrains.kotlin.fir.descriptors.ConeClassifierDescriptor
|
||||
import org.jetbrains.kotlin.fir.descriptors.ConeTypeParameterDescriptor
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.toSymbol
|
||||
import org.jetbrains.kotlin.fir.types.FirResolvedType
|
||||
import org.jetbrains.kotlin.fir.visitors.CompositeTransformResult
|
||||
import org.jetbrains.kotlin.fir.visitors.FirTransformer
|
||||
import org.jetbrains.kotlin.fir.visitors.compose
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
class FirClassifierResolveTransformer : FirTransformer<Nothing?>() {
|
||||
override fun <E : FirElement> transformElement(element: E, data: Nothing?): CompositeTransformResult<E> {
|
||||
@@ -31,11 +35,11 @@ class FirClassifierResolveTransformer : FirTransformer<Nothing?>() {
|
||||
return file.also { it.transformChildren(this, null) }.compose()
|
||||
}
|
||||
|
||||
var className: FqName = FqName.ROOT
|
||||
private var classLikeName: FqName = FqName.ROOT
|
||||
|
||||
override fun transformClass(klass: FirClass, data: Nothing?): CompositeTransformResult<FirDeclaration> {
|
||||
val actualClassName = className.child(klass.name)
|
||||
className = actualClassName
|
||||
val actualClassName = classLikeName.child(klass.name)
|
||||
classLikeName = actualClassName
|
||||
|
||||
klass.transformChildren(this, data)
|
||||
|
||||
@@ -43,7 +47,7 @@ class FirClassifierResolveTransformer : FirTransformer<Nothing?>() {
|
||||
(it as FirResolvedType).type
|
||||
}
|
||||
|
||||
className = className.parent()
|
||||
classLikeName = classLikeName.parent()
|
||||
|
||||
val typeParameters =
|
||||
klass.typeParameters.filterIsInstance<FirDescriptorOwner<*>>().mapNotNull { it.descriptor as? ConeTypeParameterDescriptor }
|
||||
@@ -65,15 +69,30 @@ class FirClassifierResolveTransformer : FirTransformer<Nothing?>() {
|
||||
return resolvedClass.compose()
|
||||
}
|
||||
|
||||
var memberName: Name? = null
|
||||
|
||||
override fun transformNamedFunction(namedFunction: FirNamedFunction, data: Nothing?): CompositeTransformResult<FirDeclaration> {
|
||||
memberName = namedFunction.name
|
||||
return super.transformNamedFunction(namedFunction, data).also {
|
||||
memberName = null
|
||||
}
|
||||
}
|
||||
|
||||
override fun transformTypeAlias(typeAlias: FirTypeAlias, data: Nothing?): CompositeTransformResult<FirDeclaration> {
|
||||
val actualClassName = classLikeName.child(typeAlias.name)
|
||||
classLikeName = actualClassName
|
||||
|
||||
typeAlias.transformChildren(this, data)
|
||||
|
||||
classLikeName = classLikeName.parent()
|
||||
|
||||
val expandedType = (typeAlias.expandedType as FirResolvedType).type
|
||||
val typeParameters =
|
||||
typeAlias.typeParameters.filterIsInstance<FirDescriptorOwner<*>>().mapNotNull { it.descriptor as? ConeTypeParameterDescriptor }
|
||||
|
||||
val descriptor = ConeTypeAliasDescriptorImpl(
|
||||
typeParameters,
|
||||
ClassId(packageFqName, className.child(typeAlias.name), false),
|
||||
ClassId(packageFqName, classLikeName.child(typeAlias.name), false),
|
||||
expandedType
|
||||
)
|
||||
|
||||
@@ -86,4 +105,18 @@ class FirClassifierResolveTransformer : FirTransformer<Nothing?>() {
|
||||
): CompositeTransformResult<FirDeclaration> {
|
||||
return resolvedTypeAlias.compose()
|
||||
}
|
||||
|
||||
override fun transformResolvedTypeParameter(
|
||||
resolvedTypeParameter: FirResolvedTypeParameter,
|
||||
data: Nothing?
|
||||
): CompositeTransformResult<FirDeclaration> {
|
||||
return resolvedTypeParameter.compose()
|
||||
}
|
||||
|
||||
override fun transformTypeParameter(typeParameter: FirTypeParameter, data: Nothing?): CompositeTransformResult<FirDeclaration> {
|
||||
typeParameter.transformChildren(this, data)
|
||||
|
||||
val descriptor = ConeTypeParameterDescriptorImpl(typeParameter.symbol)
|
||||
return FirResolvedTypeParameterImpl(typeParameter, descriptor).compose()
|
||||
}
|
||||
}
|
||||
+41
-22
@@ -6,16 +6,11 @@
|
||||
package org.jetbrains.kotlin.descriptors
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirElement
|
||||
import org.jetbrains.kotlin.fir.declarations.FirClass
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.FirFile
|
||||
import org.jetbrains.kotlin.fir.declarations.FirTypeAlias
|
||||
import org.jetbrains.kotlin.fir.FirRenderer
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.resolve.FirProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.FirTypeResolver
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirCompositeScope
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirExplicitImportingScope
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirNestedClassifierScope
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirSelfImportingScope
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.*
|
||||
import org.jetbrains.kotlin.fir.transformSingle
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.impl.FirResolvedTypeImpl
|
||||
@@ -26,6 +21,8 @@ import org.jetbrains.kotlin.fir.visitors.compose
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
|
||||
fun FirElement.render(): String = buildString { this@render.accept(FirRenderer(this)) }
|
||||
|
||||
class FirTypeResolveTransformer(val superTypesOnly: Boolean = false) : FirTransformer<Nothing?>() {
|
||||
override fun <E : FirElement> transformElement(element: E, data: Nothing?): CompositeTransformResult<E> {
|
||||
return if (superTypesOnly) {
|
||||
@@ -37,7 +34,7 @@ class FirTypeResolveTransformer(val superTypesOnly: Boolean = false) : FirTransf
|
||||
|
||||
lateinit var scope: FirCompositeScope
|
||||
lateinit var packageFqName: FqName
|
||||
var className: FqName = FqName.ROOT
|
||||
private var classLikeName: FqName = FqName.ROOT
|
||||
|
||||
override fun transformFile(file: FirFile, data: Nothing?): CompositeTransformResult<FirFile> {
|
||||
scope = FirCompositeScope(
|
||||
@@ -56,26 +53,48 @@ class FirTypeResolveTransformer(val superTypesOnly: Boolean = false) : FirTransf
|
||||
return superTypesBuilder.classes
|
||||
}
|
||||
|
||||
override fun transformClass(klass: FirClass, data: Nothing?): CompositeTransformResult<FirDeclaration> {
|
||||
klass.transformChildren(SuperTypeResolver(), null)
|
||||
className = className.child(klass.name)
|
||||
private fun resolveSuperTypesAndExpansions(element: FirMemberDeclaration) {
|
||||
try {
|
||||
element.transformChildren(SuperTypeResolver(), null)
|
||||
} catch (e: Exception) {
|
||||
class SuperTypeResolveException(cause: Exception) : Exception(element.render(), cause)
|
||||
throw SuperTypeResolveException(e)
|
||||
}
|
||||
}
|
||||
|
||||
scope.scopes += FirNestedClassifierScope(ClassId(packageFqName, className, false), klass.session)
|
||||
scope.scopes.addAll(lookupSuperTypes(klass).map { FirNestedClassifierScope(it, klass.session) })
|
||||
override fun transformClass(klass: FirClass, data: Nothing?): CompositeTransformResult<FirDeclaration> {
|
||||
classLikeName = classLikeName.child(klass.name)
|
||||
val classId = ClassId(packageFqName, classLikeName, false)
|
||||
scope = FirCompositeScope(mutableListOf(scope))
|
||||
scope.scopes += FirClassLikeTypeParameterScope(classId, klass.session)
|
||||
resolveSuperTypesAndExpansions(klass)
|
||||
|
||||
scope.scopes += FirNestedClassifierScope(classId, klass.session)
|
||||
val superTypeScopes = lookupSuperTypes(klass).map { FirNestedClassifierScope(it, klass.session) }
|
||||
scope.scopes.addAll(superTypeScopes)
|
||||
val result = super.transformClass(klass, data)
|
||||
scope.scopes.also { it.removeAt(it.lastIndex) }
|
||||
className = className.parent()
|
||||
scope = scope.scopes[0] as FirCompositeScope
|
||||
classLikeName = classLikeName.parent()
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
override fun transformTypeAlias(typeAlias: FirTypeAlias, data: Nothing?): CompositeTransformResult<FirDeclaration> {
|
||||
typeAlias.transformChildren(SuperTypeResolver(), null)
|
||||
classLikeName = classLikeName.child(typeAlias.name)
|
||||
val classId = ClassId(packageFqName, classLikeName, false)
|
||||
scope = FirCompositeScope(mutableListOf(scope))
|
||||
scope.scopes += FirClassLikeTypeParameterScope(classId, typeAlias.session)
|
||||
|
||||
resolveSuperTypesAndExpansions(typeAlias)
|
||||
|
||||
scope = scope.scopes[0] as FirCompositeScope
|
||||
classLikeName = classLikeName.parent()
|
||||
return super.transformTypeAlias(typeAlias, data)
|
||||
}
|
||||
|
||||
override fun transformType(type: FirType, data: Nothing?): CompositeTransformResult<FirType> {
|
||||
val typeResolver = FirTypeResolver.getInstance(type.session)
|
||||
type.transformChildren(this, data)
|
||||
return FirResolvedTypeImpl(
|
||||
type.session,
|
||||
type.psi,
|
||||
@@ -98,7 +117,7 @@ class FirTypeResolveTransformer(val superTypesOnly: Boolean = false) : FirTransf
|
||||
override fun transformType(type: FirType, data: Nothing?): CompositeTransformResult<FirType> {
|
||||
val transformedType = this@FirTypeResolveTransformer.transformType(type, data).single as FirResolvedType
|
||||
|
||||
val classId = (transformedType.type as? ConeClassType)?.fqName ?: return transformedType.compose()
|
||||
val classId = (transformedType.type as? ConeClassLikeType)?.symbol?.classId ?: return transformedType.compose()
|
||||
val firProvider = FirProvider.getInstance(transformedType.session)
|
||||
|
||||
val classes = generateSequence(classId) { it.outerClassId }.toList()
|
||||
@@ -123,10 +142,10 @@ class FirTypeResolveTransformer(val superTypesOnly: Boolean = false) : FirTransf
|
||||
return false
|
||||
}
|
||||
|
||||
private tailrec fun ConeClassType.computePartialExpansion(): ClassId {
|
||||
private tailrec fun ConeClassLikeType.computePartialExpansion(): ClassId {
|
||||
return when (this) {
|
||||
!is ConeAbbreviatedType -> this.fqName
|
||||
else -> (this.directExpansion as ConeClassType).computePartialExpansion()
|
||||
!is ConeAbbreviatedType -> this.symbol.classId
|
||||
else -> this.directExpansion.computePartialExpansion()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +153,7 @@ class FirTypeResolveTransformer(val superTypesOnly: Boolean = false) : FirTransf
|
||||
|
||||
override fun visitResolvedType(resolvedType: FirResolvedType, data: Nothing?): Boolean {
|
||||
val provider = FirProvider.getInstance(resolvedType.session)
|
||||
val targetClassId = resolvedType.coneTypeSafe<ConeClassType>()?.computePartialExpansion() ?: return false
|
||||
val targetClassId = resolvedType.coneTypeSafe<ConeClassLikeType>()?.computePartialExpansion() ?: return false
|
||||
val classifier = provider.getFirClassifierByFqName(targetClassId)!!
|
||||
when (classifier) {
|
||||
is FirClass -> {
|
||||
|
||||
@@ -6,22 +6,20 @@
|
||||
package org.jetbrains.kotlin.fir.resolve
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.FirFile
|
||||
import org.jetbrains.kotlin.fir.declarations.FirMemberDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.FirTypeParameter
|
||||
import org.jetbrains.kotlin.fir.service
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeSymbol
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
interface FirProvider {
|
||||
fun getFirClassifierByFqName(fqName: ClassId): FirMemberDeclaration?
|
||||
|
||||
fun getFirTypeParameterByFqName(fqName: ClassId, parameterName: Name): FirTypeParameter?
|
||||
fun getFirClassifierByFqName(fqName: ClassId): FirMemberDeclaration? // FirSymbol?
|
||||
|
||||
fun getFirClassifierContainerFile(fqName: ClassId): FirFile
|
||||
|
||||
fun getFirClassifierBySymbol(symbol: ConeSymbol): FirMemberDeclaration?
|
||||
|
||||
companion object {
|
||||
fun getInstance(session: FirSession): FirProvider = session.service()
|
||||
}
|
||||
|
||||
@@ -9,12 +9,22 @@ import org.jetbrains.kotlin.fir.FirElement
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.resolve.FirProvider
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
|
||||
import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
class FirProviderImpl(val session: FirSession) : FirProvider {
|
||||
override fun getFirClassifierBySymbol(symbol: ConeSymbol): FirMemberDeclaration? {
|
||||
return when(symbol) {
|
||||
is FirBasedSymbol<*> -> symbol.fir as? FirMemberDeclaration
|
||||
is ConeClassLikeSymbol -> getFirClassifierByFqName(symbol.classId)
|
||||
else -> error("!")
|
||||
}
|
||||
}
|
||||
|
||||
override fun getFirClassifierContainerFile(fqName: ClassId): FirFile {
|
||||
return classifierContainerFileMap[fqName] ?: error("Couldn't find container for $fqName")
|
||||
}
|
||||
@@ -60,9 +70,4 @@ class FirProviderImpl(val session: FirSession) : FirProvider {
|
||||
return classifierMap[fqName]
|
||||
}
|
||||
|
||||
override fun getFirTypeParameterByFqName(fqName: ClassId, parameterName: Name): FirTypeParameter? {
|
||||
val typeParameterContainer = (getFirClassifierByFqName(fqName) as? FirTypeParameterContainer) ?: return null
|
||||
// TODO: Optimize search here
|
||||
return typeParameterContainer.typeParameters.find { it.name == parameterName }
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -11,11 +11,9 @@ import org.jetbrains.kotlin.fir.declarations.FirMemberDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.FirTypeAlias
|
||||
import org.jetbrains.kotlin.fir.resolve.FirProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.FirQualifierResolver
|
||||
import org.jetbrains.kotlin.fir.symbols.toSymbol
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeAbbreviatedTypeImpl
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeClassTypeImpl
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeKotlinTypeProjectionInImpl
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeKotlinTypeProjectionOutImpl
|
||||
import org.jetbrains.kotlin.fir.types.impl.*
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
@@ -42,15 +40,17 @@ class FirQualifierResolverImpl(val session: FirSession) : FirQualifierResolver {
|
||||
private fun FirMemberDeclaration.toConeKotlinType(fqName: ClassId, parts: List<FirQualifierPart>): ConeKotlinType? {
|
||||
return when (this) {
|
||||
is FirClass -> {
|
||||
ConeClassTypeImpl(fqName, parts.toTypeProjections())
|
||||
ConeClassTypeImpl(fqName.toSymbol(), parts.toTypeProjections())
|
||||
}
|
||||
is FirTypeAlias -> {
|
||||
ConeAbbreviatedTypeImpl(
|
||||
abbreviationFqName = fqName,
|
||||
typeArguments = parts.toTypeProjections(),
|
||||
directExpansion = (this.expandedType as FirResolvedType).type
|
||||
)
|
||||
val expansion = expandedType.coneTypeSafe<ConeClassLikeType>()
|
||||
?: return ConeKotlinErrorType("Couldn't resolve expansion")
|
||||
|
||||
ConeAbbreviatedTypeImpl(
|
||||
abbreviationSymbol = fqName.toSymbol(),
|
||||
typeArguments = parts.toTypeProjections(),
|
||||
directExpansion = expansion
|
||||
)
|
||||
}
|
||||
else -> error("!")
|
||||
}
|
||||
@@ -61,7 +61,7 @@ class FirQualifierResolverImpl(val session: FirSession) : FirQualifierResolver {
|
||||
|
||||
val fqName = ClassId(
|
||||
prefix.packageFqName,
|
||||
parts.fold(prefix.relativeClassName) { prefix, suffix -> prefix.child(suffix.name) },
|
||||
parts.drop(1).fold(prefix.relativeClassName) { prefix, suffix -> prefix.child(suffix.name) },
|
||||
false
|
||||
)
|
||||
val foundClassifier = firProvider.getFirClassifierByFqName(fqName)
|
||||
|
||||
+14
-2
@@ -8,8 +8,11 @@ package org.jetbrains.kotlin.fir.resolve.impl
|
||||
import org.jetbrains.kotlin.fir.resolve.FirQualifierResolver
|
||||
import org.jetbrains.kotlin.fir.resolve.FirTypeResolver
|
||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeKotlinErrorType
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeTypeParameterTypeImpl
|
||||
|
||||
class FirTypeResolverImpl : FirTypeResolver {
|
||||
override fun resolveType(type: FirType, scope: FirScope): ConeKotlinType {
|
||||
@@ -20,8 +23,17 @@ class FirTypeResolverImpl : FirTypeResolver {
|
||||
val qualifierResolver = FirQualifierResolver.getInstance(type.session)
|
||||
|
||||
var resolvedType: ConeKotlinType? = null
|
||||
scope.processClassifiersByName(type.qualifier.first().name) { fqName ->
|
||||
resolvedType = qualifierResolver.resolveTypeWithPrefix(type.qualifier.drop(1), fqName)
|
||||
scope.processClassifiersByName(type.qualifier.first().name) { symbol ->
|
||||
resolvedType = when (symbol) {
|
||||
is ConeClassLikeSymbol -> {
|
||||
qualifierResolver.resolveTypeWithPrefix(type.qualifier, symbol.classId)
|
||||
}
|
||||
is ConeTypeParameterSymbol -> {
|
||||
assert(type.qualifier.size == 1)
|
||||
ConeTypeParameterTypeImpl(symbol)
|
||||
}
|
||||
else -> error("!")
|
||||
}
|
||||
resolvedType == null
|
||||
}
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.scopes
|
||||
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeSymbol
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
interface FirScope {
|
||||
fun processClassifiersByName(name: Name, processor: (ClassId) -> Boolean): Boolean
|
||||
fun processClassifiersByName(name: Name, processor: (ConeSymbol) -> Boolean): Boolean
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2010-2018 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.scopes.impl
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.resolve.FirProvider
|
||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeSymbol
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
class FirClassLikeTypeParameterScope(val classId: ClassId, val session: FirSession) : FirScope {
|
||||
|
||||
private val firProvider = FirProvider.getInstance(session)
|
||||
|
||||
val typeParameters = firProvider.getFirClassifierByFqName(classId)?.typeParameters.orEmpty().groupBy { it.name }
|
||||
|
||||
override fun processClassifiersByName(name: Name, processor: (ConeSymbol) -> Boolean): Boolean {
|
||||
val matchedTypeParameters = typeParameters[name] ?: return true
|
||||
|
||||
return matchedTypeParameters.all { processor(it.symbol) }
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,11 @@
|
||||
package org.jetbrains.kotlin.fir.scopes.impl
|
||||
|
||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeSymbol
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
class FirCompositeScope(val scopes: MutableList<FirScope>) : FirScope {
|
||||
override fun processClassifiersByName(name: Name, processor: (ClassId) -> Boolean): Boolean {
|
||||
override fun processClassifiersByName(name: Name, processor: (ConeSymbol) -> Boolean): Boolean {
|
||||
for (scope in scopes) {
|
||||
if (!scope.processClassifiersByName(name, processor)) {
|
||||
return false
|
||||
|
||||
+4
-3
@@ -8,7 +8,8 @@ package org.jetbrains.kotlin.fir.scopes.impl
|
||||
import org.jetbrains.kotlin.fir.declarations.FirImport
|
||||
import org.jetbrains.kotlin.fir.declarations.FirResolvedImport
|
||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.toSymbol
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
class FirExplicitImportingScope(imports: List<FirImport>) : FirScope {
|
||||
@@ -19,10 +20,10 @@ class FirExplicitImportingScope(imports: List<FirImport>) : FirScope {
|
||||
.filter { !it.isAllUnder }
|
||||
.groupBy { it.aliasName ?: it.resolvedFqName.shortClassName }
|
||||
|
||||
override fun processClassifiersByName(name: Name, processor: (ClassId) -> Boolean): Boolean {
|
||||
override fun processClassifiersByName(name: Name, processor: (ConeSymbol) -> Boolean): Boolean {
|
||||
val imports = simpleImports[name] ?: return true
|
||||
for (import in imports) {
|
||||
if (!processor(import.resolvedFqName)) {
|
||||
if (!processor(import.resolvedFqName.toSymbol())) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -9,6 +9,8 @@ import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.declarations.FirMemberDeclaration
|
||||
import org.jetbrains.kotlin.fir.resolve.FirProvider
|
||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.toSymbol
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
@@ -20,8 +22,8 @@ class FirNestedClassifierScope(val classId: ClassId, val session: FirSession) :
|
||||
return firProvider.getFirClassifierByFqName(this)
|
||||
}
|
||||
|
||||
override fun processClassifiersByName(name: Name, processor: (ClassId) -> Boolean): Boolean {
|
||||
override fun processClassifiersByName(name: Name, processor: (ConeSymbol) -> Boolean): Boolean {
|
||||
val child = ClassId(classId.packageFqName, classId.relativeClassName.child(name), false)
|
||||
return child.getFir() == null || processor(child)
|
||||
return child.getFir() == null || processor(child.toSymbol())
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -9,22 +9,22 @@ import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.resolve.FirProvider
|
||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||
import org.jetbrains.kotlin.fir.service
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.toSymbol
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
class FirSelfImportingScope(val fqName: FqName, val session: FirSession) : FirScope {
|
||||
override fun processClassifiersByName(name: Name, processor: (ClassId) -> Boolean): Boolean {
|
||||
|
||||
|
||||
override fun processClassifiersByName(name: Name, processor: (ConeSymbol) -> Boolean): Boolean {
|
||||
val unambiguousFqName = ClassId(fqName, name)
|
||||
|
||||
val firProvider = session.service<FirProvider>()
|
||||
|
||||
if (firProvider.getFirClassifierByFqName(unambiguousFqName) != null) {
|
||||
return processor(unambiguousFqName)
|
||||
return if (firProvider.getFirClassifierByFqName(unambiguousFqName) != null) {
|
||||
processor(unambiguousFqName.toSymbol())
|
||||
} else {
|
||||
return true
|
||||
true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,9 @@ import org.jetbrains.kotlin.descriptors.Visibilities
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.expressions.*
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeKotlinErrorType
|
||||
import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid
|
||||
@@ -293,6 +296,11 @@ class FirRenderer(builder: StringBuilder) : FirVisitorVoid() {
|
||||
println()
|
||||
}
|
||||
|
||||
override fun visitResolvedTypeParameter(resolvedTypeParameter: FirResolvedTypeParameter) {
|
||||
print("(resolved) ")
|
||||
visitTypeParameter(resolvedTypeParameter)
|
||||
}
|
||||
|
||||
override fun visitTypeParameter(typeParameter: FirTypeParameter) {
|
||||
typeParameter.annotations.renderAnnotations()
|
||||
typeParameter.variance.renderVariance()
|
||||
@@ -399,33 +407,38 @@ class FirRenderer(builder: StringBuilder) : FirVisitorVoid() {
|
||||
visitTypeWithNullability(functionType)
|
||||
}
|
||||
|
||||
private fun ConeSymbol.asString(): String {
|
||||
return when (this) {
|
||||
is ConeClassLikeSymbol -> classId.asString()
|
||||
is FirTypeParameterSymbol -> fir.name.asString()
|
||||
else -> "Unsupported: ${this::class}"
|
||||
}
|
||||
}
|
||||
|
||||
private fun ConeKotlinType.asString(): String {
|
||||
return when (this) {
|
||||
is ConeKotlinErrorType -> "error: $reason"
|
||||
is ConeClassType -> {
|
||||
is ConeClassLikeType -> {
|
||||
val sb = StringBuilder()
|
||||
val fqName = fqName
|
||||
val packageFqName = fqName.packageFqName
|
||||
if (packageFqName.isRoot) {
|
||||
sb.append("<root>")
|
||||
} else {
|
||||
sb.append(packageFqName.asString().replace('.', '/'))
|
||||
sb.append(symbol.classId.asString())
|
||||
if (typeArguments.isNotEmpty()) {
|
||||
sb.append(typeArguments.joinToString(prefix = "<", postfix = ">") { it ->
|
||||
when (it) {
|
||||
StarProjection -> "*"
|
||||
is ConeKotlinTypeProjectionIn -> "in ${it.type.asString()}"
|
||||
is ConeKotlinTypeProjectionOut -> "out ${it.type.asString()}"
|
||||
is ConeKotlinType -> it.asString()
|
||||
}
|
||||
})
|
||||
}
|
||||
sb.append('.')
|
||||
sb.append(fqName.relativeClassName.asString())
|
||||
sb.append(typeArguments.joinToString { it ->
|
||||
when (it) {
|
||||
StarProjection -> "*"
|
||||
is ConeKotlinTypeProjectionIn -> "in ${it.type.asString()}"
|
||||
is ConeKotlinTypeProjectionOut -> "out ${it.type.asString()}"
|
||||
is ConeKotlinType -> it.asString()
|
||||
}
|
||||
})
|
||||
if (this is ConeAbbreviatedType) {
|
||||
sb.append(" = ${this.directExpansion.asString()}")
|
||||
}
|
||||
sb.toString()
|
||||
}
|
||||
is ConeTypeParameterType -> {
|
||||
symbol.asString()
|
||||
}
|
||||
else -> "Unsupported: $this"
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright 2010-2018 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.declarations
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirDescriptorOwner
|
||||
import org.jetbrains.kotlin.fir.visitors.FirVisitor
|
||||
|
||||
interface FirResolvedTypeParameter : FirTypeParameter, FirDescriptorOwner<FirResolvedTypeParameter> {
|
||||
|
||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R =
|
||||
visitor.visitResolvedTypeParameter(this, data)
|
||||
}
|
||||
@@ -7,16 +7,22 @@ package org.jetbrains.kotlin.fir.declarations
|
||||
|
||||
import org.jetbrains.kotlin.fir.BaseTransformedType
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotationContainer
|
||||
import org.jetbrains.kotlin.fir.symbols.FirSymbolOwner
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.types.FirType
|
||||
import org.jetbrains.kotlin.fir.visitors.FirVisitor
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
|
||||
@BaseTransformedType
|
||||
interface FirTypeParameter : FirNamedDeclaration, FirAnnotationContainer {
|
||||
interface FirTypeParameter : FirNamedDeclaration, FirAnnotationContainer, FirSymbolOwner<FirTypeParameter> {
|
||||
val variance: Variance
|
||||
|
||||
val isReified: Boolean
|
||||
|
||||
val bounds: List<FirType>
|
||||
|
||||
override val symbol: FirTypeParameterSymbol
|
||||
|
||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R =
|
||||
visitor.visitTypeParameter(this, data)
|
||||
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2010-2018 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.declarations.impl
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirBasedDescriptor
|
||||
import org.jetbrains.kotlin.fir.declarations.FirResolvedTypeParameter
|
||||
import org.jetbrains.kotlin.fir.declarations.FirTypeParameter
|
||||
import org.jetbrains.kotlin.fir.visitors.FirVisitor
|
||||
import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid
|
||||
|
||||
class FirResolvedTypeParameterImpl(val delegate: FirTypeParameter, override val descriptor: FirBasedDescriptor<FirResolvedTypeParameter>) :
|
||||
FirResolvedTypeParameter, FirTypeParameter by delegate {
|
||||
|
||||
init {
|
||||
symbol.bind(this)
|
||||
descriptor.bind(this)
|
||||
}
|
||||
|
||||
override fun accept(visitor: FirVisitorVoid) {
|
||||
return super<FirResolvedTypeParameter>.accept(visitor)
|
||||
}
|
||||
|
||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R {
|
||||
return super<FirResolvedTypeParameter>.accept(visitor, data)
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.FirElement
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.declarations.FirTypeAlias
|
||||
import org.jetbrains.kotlin.fir.transformInplace
|
||||
import org.jetbrains.kotlin.fir.transformSingle
|
||||
import org.jetbrains.kotlin.fir.types.FirType
|
||||
import org.jetbrains.kotlin.fir.visitors.FirTransformer
|
||||
@@ -24,6 +25,7 @@ class FirTypeAliasImpl(
|
||||
override var expandedType: FirType
|
||||
) : FirAbstractMemberDeclaration(session, psi, name, visibility, Modality.FINAL), FirTypeAlias {
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirElement {
|
||||
typeParameters.transformInplace(transformer, data)
|
||||
expandedType = expandedType.transformSingle(transformer, data)
|
||||
|
||||
return this
|
||||
|
||||
+17
-1
@@ -6,9 +6,13 @@
|
||||
package org.jetbrains.kotlin.fir.declarations.impl
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.fir.FirElement
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.declarations.FirTypeParameter
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.transformInplace
|
||||
import org.jetbrains.kotlin.fir.types.FirType
|
||||
import org.jetbrains.kotlin.fir.visitors.FirTransformer
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
|
||||
@@ -16,7 +20,19 @@ class FirTypeParameterImpl(
|
||||
session: FirSession,
|
||||
psi: PsiElement?,
|
||||
name: Name,
|
||||
override val variance: Variance
|
||||
override val variance: Variance,
|
||||
override val isReified: Boolean,
|
||||
override val symbol: FirTypeParameterSymbol
|
||||
) : FirAbstractNamedAnnotatedDeclaration(session, psi, name), FirTypeParameter {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
override val bounds = mutableListOf<FirType>()
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirElement {
|
||||
bounds.transformInplace(transformer, data)
|
||||
|
||||
return this
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2010-2018 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.symbols
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirElement
|
||||
|
||||
abstract class AbstractFirBasedSymbol<E> : FirBasedSymbol<E> where E : FirElement, E : FirSymbolOwner<E> {
|
||||
|
||||
override lateinit var fir: E
|
||||
|
||||
override fun bind(e: E) {
|
||||
fir = e
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright 2010-2018 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.symbols
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirElement
|
||||
|
||||
interface FirBasedSymbol<E> : ConeSymbol where E : FirElement, E : FirSymbolOwner<E> {
|
||||
val fir: E
|
||||
|
||||
fun bind(e: E)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright 2010-2018 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.symbols
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirElement
|
||||
|
||||
interface FirSymbolOwner<E> where E : FirElement, E : FirSymbolOwner<E> {
|
||||
val symbol: FirBasedSymbol<E>
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright 2010-2018 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.symbols.impl
|
||||
|
||||
import org.jetbrains.kotlin.fir.declarations.FirTypeParameter
|
||||
import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterSymbol
|
||||
|
||||
class FirTypeParameterSymbol : AbstractFirBasedSymbol<FirTypeParameter>(), ConeTypeParameterSymbol
|
||||
@@ -15,4 +15,4 @@ interface FirResolvedType : FirTypeWithNullability {
|
||||
}
|
||||
|
||||
inline fun <reified T : ConeKotlinType> FirType.coneTypeUnsafe() = (this as FirResolvedType).type as T
|
||||
inline fun <reified T : ConeKotlinType> FirType.coneTypeSafe() = (this as FirResolvedType).type as? T
|
||||
inline fun <reified T : ConeKotlinType> FirType.coneTypeSafe() = (this as? FirResolvedType)?.type as? T
|
||||
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.fir.types.impl
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
import org.jetbrains.kotlin.fir.symbols.toSymbol
|
||||
import org.jetbrains.kotlin.fir.types.ConeKotlinType
|
||||
import org.jetbrains.kotlin.fir.types.FirResolvedType
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
@@ -23,7 +24,8 @@ sealed class FirBuiltinType(
|
||||
ClassId(
|
||||
KOTLIN_PACKAGE_FQ_NAME,
|
||||
Name.identifier(name)
|
||||
), emptyList()
|
||||
).toSymbol(),
|
||||
emptyList()
|
||||
)
|
||||
|
||||
final override val isNullable = false
|
||||
|
||||
@@ -6,17 +6,29 @@
|
||||
package org.jetbrains.kotlin.fir.types.impl
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.fir.FirElement
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.declarations.FirValueParameter
|
||||
import org.jetbrains.kotlin.fir.transformInplace
|
||||
import org.jetbrains.kotlin.fir.transformSingle
|
||||
import org.jetbrains.kotlin.fir.types.FirFunctionType
|
||||
import org.jetbrains.kotlin.fir.types.FirType
|
||||
import org.jetbrains.kotlin.fir.visitors.FirTransformer
|
||||
|
||||
class FirFunctionTypeImpl(
|
||||
session: FirSession,
|
||||
psi: PsiElement?,
|
||||
isNullable: Boolean,
|
||||
override val receiverType: FirType?,
|
||||
override val returnType: FirType
|
||||
override var receiverType: FirType?,
|
||||
override var returnType: FirType
|
||||
) : FirAbstractAnnotatedType(session, psi, isNullable), FirFunctionType {
|
||||
override val valueParameters = mutableListOf<FirValueParameter>()
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirElement {
|
||||
receiverType = receiverType?.transformSingle(transformer, data)
|
||||
returnType = returnType.transformSingle(transformer, data)
|
||||
valueParameters.transformInplace(transformer, data)
|
||||
|
||||
return this
|
||||
}
|
||||
}
|
||||
+11
-2
@@ -6,14 +6,23 @@
|
||||
package org.jetbrains.kotlin.fir.types.impl
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.fir.FirElement
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.transformSingle
|
||||
import org.jetbrains.kotlin.fir.types.FirType
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeProjectionWithVariance
|
||||
import org.jetbrains.kotlin.fir.visitors.FirTransformer
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
|
||||
class FirTypeProjectionWithVarianceImpl(
|
||||
override val session: FirSession,
|
||||
override val psi: PsiElement?,
|
||||
override val variance: Variance,
|
||||
override val type: FirType
|
||||
) : FirTypeProjectionWithVariance
|
||||
override var type: FirType
|
||||
) : FirTypeProjectionWithVariance {
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirElement {
|
||||
type = type.transformSingle(transformer, data)
|
||||
|
||||
return this
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,14 @@
|
||||
package org.jetbrains.kotlin.fir.types.impl
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.fir.FirElement
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.transformInplace
|
||||
import org.jetbrains.kotlin.fir.types.FirQualifierPart
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeProjection
|
||||
import org.jetbrains.kotlin.fir.types.FirUserType
|
||||
import org.jetbrains.kotlin.fir.visitors.FirTransformer
|
||||
import org.jetbrains.kotlin.types.TypeProjectionBase
|
||||
import java.util.*
|
||||
|
||||
class FirUserTypeImpl(
|
||||
@@ -17,4 +22,12 @@ class FirUserTypeImpl(
|
||||
isNullable: Boolean
|
||||
) : FirAbstractAnnotatedType(session, psi, isNullable), FirUserType {
|
||||
override val qualifier = LinkedList<FirQualifierPart>()
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirElement {
|
||||
for (part in qualifier) {
|
||||
(part.typeArguments as MutableList<FirTypeProjection>).transformInplace(transformer, data)
|
||||
}
|
||||
|
||||
return this
|
||||
}
|
||||
}
|
||||
+12
-4
@@ -82,6 +82,10 @@ abstract class FirTransformer<in D> : FirVisitor<CompositeTransformResult<FirEle
|
||||
return transformNamedDeclaration(typeParameter, data)
|
||||
}
|
||||
|
||||
open fun transformResolvedTypeParameter(resolvedTypeParameter: FirResolvedTypeParameter, data: D): CompositeTransformResult<FirDeclaration> {
|
||||
return transformTypeParameter(resolvedTypeParameter, data)
|
||||
}
|
||||
|
||||
open fun transformProperty(property: FirProperty, data: D): CompositeTransformResult<FirDeclaration> {
|
||||
return transformDeclaration(property, data)
|
||||
}
|
||||
@@ -246,6 +250,10 @@ abstract class FirTransformer<in D> : FirVisitor<CompositeTransformResult<FirEle
|
||||
return transformTypeAlias(typeAlias, data)
|
||||
}
|
||||
|
||||
final override fun visitTypeParameter(typeParameter: FirTypeParameter, data: D): CompositeTransformResult<FirElement> {
|
||||
return transformTypeParameter(typeParameter, data)
|
||||
}
|
||||
|
||||
final override fun visitTypeProjection(typeProjection: FirTypeProjection, data: D): CompositeTransformResult<FirElement> {
|
||||
return transformTypeProjection(typeProjection, data)
|
||||
}
|
||||
@@ -322,10 +330,6 @@ abstract class FirTransformer<in D> : FirVisitor<CompositeTransformResult<FirEle
|
||||
return transformResolvedImport(resolvedImport, data)
|
||||
}
|
||||
|
||||
final override fun visitTypeParameter(typeParameter: FirTypeParameter, data: D): CompositeTransformResult<FirElement> {
|
||||
return transformTypeParameter(typeParameter, data)
|
||||
}
|
||||
|
||||
final override fun visitFile(file: FirFile, data: D): CompositeTransformResult<FirElement> {
|
||||
return transformFile(file, data)
|
||||
}
|
||||
@@ -346,6 +350,10 @@ abstract class FirTransformer<in D> : FirVisitor<CompositeTransformResult<FirEle
|
||||
return transformResolvedTypeAlias(resolvedTypeAlias, data)
|
||||
}
|
||||
|
||||
final override fun visitResolvedTypeParameter(resolvedTypeParameter: FirResolvedTypeParameter, data: D): CompositeTransformResult<FirElement> {
|
||||
return transformResolvedTypeParameter(resolvedTypeParameter, data)
|
||||
}
|
||||
|
||||
final override fun visitStarProjection(starProjection: FirStarProjection, data: D): CompositeTransformResult<FirElement> {
|
||||
return transformStarProjection(starProjection, data)
|
||||
}
|
||||
|
||||
@@ -82,6 +82,10 @@ abstract class FirVisitor<out R, in D> {
|
||||
return visitNamedDeclaration(typeParameter, data)
|
||||
}
|
||||
|
||||
open fun visitResolvedTypeParameter(resolvedTypeParameter: FirResolvedTypeParameter, data: D): R {
|
||||
return visitTypeParameter(resolvedTypeParameter, data)
|
||||
}
|
||||
|
||||
open fun visitProperty(property: FirProperty, data: D): R {
|
||||
return visitDeclaration(property, data)
|
||||
}
|
||||
|
||||
+12
-4
@@ -82,6 +82,10 @@ abstract class FirVisitorVoid : FirVisitor<Unit, Nothing?>() {
|
||||
visitNamedDeclaration(typeParameter, null)
|
||||
}
|
||||
|
||||
open fun visitResolvedTypeParameter(resolvedTypeParameter: FirResolvedTypeParameter) {
|
||||
visitTypeParameter(resolvedTypeParameter, null)
|
||||
}
|
||||
|
||||
open fun visitProperty(property: FirProperty) {
|
||||
visitDeclaration(property, null)
|
||||
}
|
||||
@@ -246,6 +250,10 @@ abstract class FirVisitorVoid : FirVisitor<Unit, Nothing?>() {
|
||||
visitTypeAlias(typeAlias)
|
||||
}
|
||||
|
||||
final override fun visitTypeParameter(typeParameter: FirTypeParameter, data: Nothing?) {
|
||||
visitTypeParameter(typeParameter)
|
||||
}
|
||||
|
||||
final override fun visitTypeProjection(typeProjection: FirTypeProjection, data: Nothing?) {
|
||||
visitTypeProjection(typeProjection)
|
||||
}
|
||||
@@ -322,10 +330,6 @@ abstract class FirVisitorVoid : FirVisitor<Unit, Nothing?>() {
|
||||
visitResolvedImport(resolvedImport)
|
||||
}
|
||||
|
||||
final override fun visitTypeParameter(typeParameter: FirTypeParameter, data: Nothing?) {
|
||||
visitTypeParameter(typeParameter)
|
||||
}
|
||||
|
||||
final override fun visitFile(file: FirFile, data: Nothing?) {
|
||||
visitFile(file)
|
||||
}
|
||||
@@ -346,6 +350,10 @@ abstract class FirVisitorVoid : FirVisitor<Unit, Nothing?>() {
|
||||
visitResolvedTypeAlias(resolvedTypeAlias)
|
||||
}
|
||||
|
||||
final override fun visitResolvedTypeParameter(resolvedTypeParameter: FirResolvedTypeParameter, data: Nothing?) {
|
||||
visitResolvedTypeParameter(resolvedTypeParameter)
|
||||
}
|
||||
|
||||
final override fun visitStarProjection(starProjection: FirStarProjection, data: Nothing?) {
|
||||
visitStarProjection(starProjection)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
FILE: genericFunctions.kt
|
||||
public? final? interface Any() {
|
||||
}
|
||||
<T : Any> public? final? inline function safeAsAny.(): T? {
|
||||
<reified T : Any> public? final? inline function safeAsAny.(): T? {
|
||||
STUB
|
||||
}
|
||||
public? abstract class Summator() {
|
||||
|
||||
@@ -22,6 +22,6 @@ FILE: simpleClass.kt
|
||||
|
||||
public? final? property fau(var): Double
|
||||
public? get(): Double
|
||||
public? set(value: Double): R/kotlin.Unit/
|
||||
public? set(value: Double): R/kotlin/Unit/
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@ FILE: typeAliasWithGeneric.kt
|
||||
}
|
||||
<S, T : A> public? final? interface B() {
|
||||
}
|
||||
public? final typealias C = B<T, A>
|
||||
<T> public? final typealias C = B<T, A>
|
||||
public? final? class D() : C<A> {
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
FILE: F.kt
|
||||
(resolved) public? open class A() {
|
||||
}
|
||||
(resolved) public? final class B() : R/<root>.A/ {
|
||||
(resolved) public? final class B() : R/A/ {
|
||||
}
|
||||
|
||||
+3
-3
@@ -4,9 +4,9 @@ FILE: NestedOfAliasedType.kt
|
||||
}
|
||||
|
||||
}
|
||||
(resolved) public? final typealias TA = R/<root>.A/
|
||||
(resolved) public? final class B() : R/<root>.TA = <root>.A/ {
|
||||
(resolved) public? final class NestedInB() : R/<root>.A.Nested/ {
|
||||
(resolved) public? final typealias TA = R/A/
|
||||
(resolved) public? final class B() : R/TA = A/ {
|
||||
(resolved) public? final class NestedInB() : R/A.Nested/ {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,14 +1,14 @@
|
||||
FILE: NestedSuperType.kt
|
||||
(resolved) public? abstract class My() {
|
||||
(resolved) public? abstract class NestedOne() : R/p.My/ {
|
||||
(resolved) public? abstract class NestedTwo() : R/p.My.NestedOne/ {
|
||||
(resolved) public? abstract class NestedOne() : R/p/My/ {
|
||||
(resolved) public? abstract class NestedTwo() : R/p/My.NestedOne/ {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
(resolved) public? final class Your() : R/p.My/ {
|
||||
(resolved) public? final class NestedThree() : R/p.My.NestedOne/ {
|
||||
(resolved) public? final class Your() : R/p/My/ {
|
||||
(resolved) public? final class NestedThree() : R/p/My.NestedOne/ {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
FILE: TwoDeclarationsInSameFile.kt
|
||||
(resolved) public? open class A() {
|
||||
}
|
||||
(resolved) public? final class B() : R/p.A/ {
|
||||
(resolved) public? final class B() : R/p/A/ {
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
FILE: NestedSuperType.kt
|
||||
(resolved) public? final class A() : R/b.B/ {
|
||||
(resolved) public? final class NestedInA1() : R/b.B.NestedInB/ {
|
||||
(resolved) public? final class A() : R/b/B/ {
|
||||
(resolved) public? final class NestedInA1() : R/b/B.NestedInB/ {
|
||||
}
|
||||
|
||||
(resolved) public? final class NestedInA2() : R/c.C.NestedInC/ {
|
||||
(resolved) public? final class NestedInA2() : R/c/C.NestedInC/ {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FILE: simpleAliasedImport.kt
|
||||
(resolved) public? final class YourClass() : R/b.MyClass/ {
|
||||
(resolved) public? final class YourClass() : R/b/MyClass/ {
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FILE: simpleImport.kt
|
||||
(resolved) public? final class YourClass() : R/b.MyClass/ {
|
||||
(resolved) public? final class YourClass() : R/b/MyClass/ {
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FILE: simpleImportNested.kt
|
||||
(resolved) public? final class YourClass() : R/a.MyClass.MyNested/ {
|
||||
(resolved) public? final class YourClass() : R/a/MyClass.MyNested/ {
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FILE: simpleImportOuter.kt
|
||||
(resolved) public? final class My() : R/a.Outer.Nested/ {
|
||||
(resolved) public? final class My() : R/a/Outer.Nested/ {
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ FILE: simpleClass.kt
|
||||
public? get(): R/error: Failed to resolve qualified type/
|
||||
|
||||
}
|
||||
(resolved) public? final class SomeClass() : R/<root>.SomeInterface/ {
|
||||
(resolved) public? final class SomeClass() : R/SomeInterface/ {
|
||||
private final? property baz(val): R/error: Not supported: FirImplicitTypeImpl/ = STUB
|
||||
public? get(): R/error: Not supported: FirImplicitTypeImpl/
|
||||
|
||||
@@ -22,6 +22,6 @@ FILE: simpleClass.kt
|
||||
|
||||
public? final? property fau(var): R/error: Failed to resolve qualified type/
|
||||
public? get(): R/error: Failed to resolve qualified type/
|
||||
public? set(value: R/error: Failed to resolve qualified type/): R/kotlin.Unit/
|
||||
public? set(value: R/error: Failed to resolve qualified type/): R/kotlin/Unit/
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
FILE: simpleTypeAlias.kt
|
||||
(resolved) public? abstract interface B() {
|
||||
}
|
||||
(resolved) public? final typealias C = R/<root>.B/
|
||||
(resolved) public? final class D() : R/<root>.C = <root>.B/ {
|
||||
(resolved) public? final typealias C = R/B/
|
||||
(resolved) public? final class D() : R/C = B/ {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
open class A
|
||||
|
||||
interface B<S, T : A>
|
||||
|
||||
typealias C<T> = B<T, A>
|
||||
|
||||
class D : C<A>
|
||||
@@ -0,0 +1,8 @@
|
||||
FILE: typeAliasWithGeneric.kt
|
||||
(resolved) public? open class A() {
|
||||
}
|
||||
(resolved) <(resolved) S, (resolved) T : R/A/> public? abstract interface B() {
|
||||
}
|
||||
(resolved) <(resolved) T> public? final typealias C = R/B<T, A>/
|
||||
(resolved) public? final class D() : R/C<A> = B<T, A>/ {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package test
|
||||
|
||||
interface Some
|
||||
|
||||
abstract class My<T : Some> {
|
||||
inner class T
|
||||
|
||||
abstract val x: T
|
||||
|
||||
abstract fun foo(arg: T)
|
||||
|
||||
abstract val y: My.T
|
||||
|
||||
abstract val z: test.My.T
|
||||
|
||||
class Some : T()
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
FILE: typeParameterVsNested.kt
|
||||
(resolved) public? abstract interface Some() {
|
||||
}
|
||||
(resolved) <(resolved) T : R/test/Some/> public? abstract class My() {
|
||||
(resolved) public? final class T(inner) {
|
||||
}
|
||||
|
||||
public? abstract property x(val): R/T/
|
||||
public? get(): R/T/
|
||||
|
||||
public? abstract function foo(arg: R/T/): R/error: Not supported: FirImplicitTypeImpl/
|
||||
|
||||
public? abstract property y(val): R/test/My.T/
|
||||
public? get(): R/test/My.T/
|
||||
|
||||
public? abstract property z(val): R/test/My.T/
|
||||
public? get(): R/test/My.T/
|
||||
|
||||
(resolved) public? final class Some() : R/T/ {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,6 +61,18 @@ public class FirResolveTestCaseGenerated extends AbstractFirResolveTestCase {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("typeAliasWithGeneric.kt")
|
||||
public void testTypeAliasWithGeneric() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/typeAliasWithGeneric.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("typeParameterVsNested.kt")
|
||||
public void testTypeParameterVsNested() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/typeParameterVsNested.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/fir/resolve/multifile")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user