[FIR] Introduce & use FirTypeRef.coneType
This commit is contained in:
+2
-2
@@ -15,12 +15,12 @@ import org.jetbrains.kotlin.fir.resolve.toSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
|
||||
import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.coneType
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
private fun FirAnnotationCall.toAnnotationLookupTag(): ConeClassLikeLookupTag =
|
||||
((annotationTypeRef as FirResolvedTypeRef).type as ConeClassLikeType).lookupTag
|
||||
(annotationTypeRef.coneType as ConeClassLikeType).lookupTag
|
||||
|
||||
internal fun FirAnnotationCall.toAnnotationClassId(): ClassId =
|
||||
toAnnotationLookupTag().classId
|
||||
|
||||
+6
-8
@@ -488,13 +488,11 @@ class FirElementSerializer private constructor(
|
||||
}
|
||||
|
||||
if (parameter.isVararg) {
|
||||
val varargElementType = parameter.returnTypeRef.coneTypeSafe<ConeKotlinType>()?.varargElementType(session)
|
||||
if (varargElementType != null) {
|
||||
if (useTypeTable()) {
|
||||
builder.varargElementTypeId = typeId(varargElementType)
|
||||
} else {
|
||||
builder.setVarargElementType(typeProto(varargElementType))
|
||||
}
|
||||
val varargElementType = parameter.returnTypeRef.coneType.varargElementType(session)
|
||||
if (useTypeTable()) {
|
||||
builder.varargElementTypeId = typeId(varargElementType)
|
||||
} else {
|
||||
builder.setVarargElementType(typeProto(varargElementType))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -544,7 +542,7 @@ class FirElementSerializer private constructor(
|
||||
fun typeId(type: ConeKotlinType): Int = typeTable[typeProto(type)]
|
||||
|
||||
internal fun typeProto(typeRef: FirTypeRef): ProtoBuf.Type.Builder {
|
||||
return typeProto((typeRef as FirResolvedTypeRef).type)
|
||||
return typeProto(typeRef.coneType)
|
||||
}
|
||||
|
||||
internal fun typeProto(type: ConeKotlinType): ProtoBuf.Type.Builder {
|
||||
|
||||
Reference in New Issue
Block a user