[FIR] Introduce utility for creating ConeClassLikeLookupTagImpl from ClassId
`classId.toLookupTag()` looks much cleaner than `ConeClassLikeLookupTagImpl(classId)`
This commit is contained in:
committed by
Space Team
parent
6c449e29cd
commit
125b773205
+1
-2
@@ -20,7 +20,6 @@ import org.jetbrains.kotlin.fir.declarations.utils.fromPrimaryConstructor
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
import org.jetbrains.kotlin.fir.resolve.fullyExpandedType
|
||||
import org.jetbrains.kotlin.fir.resolve.toFirRegularClassSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.ConeClassLikeLookupTagImpl
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
@@ -123,7 +122,7 @@ object FirParcelizeAnnotationChecker : FirAnnotationCallChecker() {
|
||||
val targetType = (context.annotationContainers.lastOrNull() as? FirTypeRef)?.coneType?.withAttributes(ConeAttributes.Empty)
|
||||
?: return
|
||||
val expectedType = ConeClassLikeTypeImpl(
|
||||
ConeClassLikeLookupTagImpl(ParcelizeNames.PARCELER_ID),
|
||||
ParcelizeNames.PARCELER_ID.toLookupTag(),
|
||||
arrayOf(targetType),
|
||||
isNullable = false
|
||||
)
|
||||
|
||||
+2
-6
@@ -16,13 +16,9 @@ import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.*
|
||||
import org.jetbrains.kotlin.fir.resolve.fullyExpandedType
|
||||
import org.jetbrains.kotlin.fir.resolve.lookupSuperTypes
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.ConeClassLikeLookupTagImpl
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
|
||||
import org.jetbrains.kotlin.fir.types.classId
|
||||
import org.jetbrains.kotlin.fir.types.coneType
|
||||
import org.jetbrains.kotlin.fir.types.toRegularClassSymbol
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl
|
||||
import org.jetbrains.kotlin.fir.types.isSubtypeOf
|
||||
import org.jetbrains.kotlin.name.SpecialNames
|
||||
import org.jetbrains.kotlin.parcelize.ParcelizeNames.CREATOR_NAME
|
||||
import org.jetbrains.kotlin.parcelize.ParcelizeNames.OLD_PARCELER_ID
|
||||
@@ -81,7 +77,7 @@ object FirParcelizeClassChecker : FirClassChecker() {
|
||||
val superTypeRef = klass.superTypeRefs[index]
|
||||
val superType = superTypeRef.coneType
|
||||
val parcelableType = ConeClassLikeTypeImpl(
|
||||
ConeClassLikeLookupTagImpl(PARCELABLE_ID),
|
||||
PARCELABLE_ID.toLookupTag(),
|
||||
emptyArray(),
|
||||
isNullable = false
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user