[FIR] Match type in super<type> access with actual supertypes of class
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.types
|
||||
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.utils.SmartSet
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
@@ -33,4 +34,10 @@ private fun ConeKotlinType.contains(predicate: (ConeKotlinType) -> Boolean, visi
|
||||
is ConeIntersectionType -> intersectedTypes.any { it.contains(predicate, visited) }
|
||||
else -> typeArguments.any { it is ConeKotlinTypeProjection && it.type.contains(predicate, visited) }
|
||||
}
|
||||
}
|
||||
|
||||
fun ConeClassLikeType.withArguments(typeArguments: Array<out ConeTypeProjection>): ConeClassLikeType = when (this) {
|
||||
is ConeClassLikeTypeImpl -> ConeClassLikeTypeImpl(lookupTag, typeArguments, isNullable, attributes)
|
||||
is ConeClassErrorType -> this
|
||||
else -> error("Unknown cone type: ${this::class}")
|
||||
}
|
||||
Reference in New Issue
Block a user