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()
|
||||
Reference in New Issue
Block a user