FIR: unify common special names scattered around the code base
This commit is contained in:
committed by
teamcityserver
parent
263b876e6e
commit
684ef871ee
+1
-1
@@ -16,7 +16,7 @@ import org.jetbrains.kotlin.types.Variance
|
||||
public sealed class KtClassifierSymbol : KtSymbol, KtPossiblyNamedSymbol
|
||||
|
||||
public val KtClassifierSymbol.nameOrAnonymous: Name
|
||||
get() = name ?: SpecialNames.ANONYMOUS_FUNCTION
|
||||
get() = name ?: SpecialNames.ANONYMOUS
|
||||
|
||||
public abstract class KtTypeParameterSymbol : KtClassifierSymbol(), KtNamedSymbol {
|
||||
abstract override fun createPointer(): KtSymbolPointer<KtTypeParameterSymbol>
|
||||
|
||||
@@ -90,7 +90,7 @@ private class AnonymousTypesSubstitutor(
|
||||
|
||||
if (type !is ConeClassLikeType) return null
|
||||
|
||||
val isAnonymous = type.classId.let { it?.shortClassName?.asString() == SpecialNames.ANONYMOUS }
|
||||
val isAnonymous = type.classId.let { it?.shortClassName?.asString() == SpecialNames.ANONYMOUS_STRING }
|
||||
if (!isAnonymous) return null
|
||||
|
||||
fun ConeClassLikeType.isNotInterface(): Boolean {
|
||||
@@ -134,7 +134,7 @@ internal fun ConeKotlinType.asPsiType(
|
||||
val canonicalSignature = signatureWriter.toString()
|
||||
|
||||
if (canonicalSignature.contains("L<error>")) return psiContext.nonExistentType()
|
||||
require(!canonicalSignature.contains(SpecialNames.ANONYMOUS))
|
||||
require(!canonicalSignature.contains(SpecialNames.ANONYMOUS_STRING))
|
||||
|
||||
val signature = StringCharacterIterator(canonicalSignature)
|
||||
val javaType = SignatureParsing.parseTypeString(signature, StubBuildingVisitor.GUESSING_MAPPER)
|
||||
@@ -301,7 +301,7 @@ internal fun KtType.getTypeNullability(context: KtSymbol, phase: FirResolvePhase
|
||||
|
||||
if (coneType is ConeClassErrorType) return NullabilityType.NotNull
|
||||
if (coneType.typeArguments.any { it is ConeClassErrorType }) return NullabilityType.NotNull
|
||||
if (coneType.classId?.shortClassName?.asString() == SpecialNames.ANONYMOUS) return NullabilityType.NotNull
|
||||
if (coneType.classId?.shortClassName?.asString() == SpecialNames.ANONYMOUS_STRING) return NullabilityType.NotNull
|
||||
|
||||
val canonicalSignature = context.firRef.withFir(phase) {
|
||||
it.moduleData.session.jvmTypeMapper.mapType(coneType, TypeMappingMode.DEFAULT).descriptor
|
||||
|
||||
Reference in New Issue
Block a user