[NI] Remove capturing from supertypes during computation of CST
This commit is contained in:
+2
-1
@@ -26,11 +26,12 @@ import org.jetbrains.kotlin.types.Variance.IN_VARIANCE
|
||||
import org.jetbrains.kotlin.types.Variance.OUT_VARIANCE
|
||||
import org.jetbrains.kotlin.types.checker.KotlinTypeRefiner
|
||||
import org.jetbrains.kotlin.types.checker.NewCapturedTypeConstructor
|
||||
import org.jetbrains.kotlin.types.model.CapturedTypeConstructorMarker
|
||||
import org.jetbrains.kotlin.types.model.CapturedTypeMarker
|
||||
import org.jetbrains.kotlin.types.refinement.TypeRefinement
|
||||
import org.jetbrains.kotlin.types.typeUtil.builtIns
|
||||
|
||||
interface CapturedTypeConstructor : TypeConstructor {
|
||||
interface CapturedTypeConstructor : CapturedTypeConstructorMarker, TypeConstructor {
|
||||
val projection: TypeProjection
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.FqNameUnsafe
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.CapturedType
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.CapturedTypeConstructorImpl
|
||||
import org.jetbrains.kotlin.resolve.constants.IntegerLiteralTypeConstructor
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.hasExactAnnotation
|
||||
@@ -138,6 +139,16 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy
|
||||
return this.constructor
|
||||
}
|
||||
|
||||
override fun CapturedTypeMarker.typeConstructor(): CapturedTypeConstructorMarker {
|
||||
require(this is NewCapturedType, this::errorMessage)
|
||||
return this.constructor
|
||||
}
|
||||
|
||||
override fun CapturedTypeConstructorMarker.projection(): TypeArgumentMarker {
|
||||
require(this is NewCapturedTypeConstructor, this::errorMessage)
|
||||
return this.projection
|
||||
}
|
||||
|
||||
override fun KotlinTypeMarker.argumentsCount(): Int {
|
||||
require(this is KotlinType, this::errorMessage)
|
||||
return this.arguments.size
|
||||
|
||||
@@ -26,6 +26,8 @@ interface TypeArgumentListMarker
|
||||
interface TypeVariableMarker
|
||||
interface TypeVariableTypeConstructorMarker : TypeConstructorMarker
|
||||
|
||||
interface CapturedTypeConstructorMarker : TypeConstructorMarker
|
||||
|
||||
interface TypeSubstitutorMarker
|
||||
|
||||
|
||||
@@ -147,7 +149,6 @@ interface TypeSystemInferenceExtensionContext : TypeSystemContext, TypeSystemBui
|
||||
fun KotlinTypeMarker.mayBeTypeVariable(): Boolean
|
||||
|
||||
fun CapturedTypeMarker.typeConstructorProjection(): TypeArgumentMarker
|
||||
fun CapturedTypeMarker.captureStatus(): CaptureStatus
|
||||
|
||||
fun DefinitelyNotNullTypeMarker.original(): SimpleTypeMarker
|
||||
|
||||
@@ -187,6 +188,10 @@ interface TypeSystemContext : TypeSystemOptimizationContext {
|
||||
fun SimpleTypeMarker.withNullability(nullable: Boolean): SimpleTypeMarker
|
||||
fun SimpleTypeMarker.typeConstructor(): TypeConstructorMarker
|
||||
|
||||
fun CapturedTypeMarker.typeConstructor(): CapturedTypeConstructorMarker
|
||||
fun CapturedTypeMarker.captureStatus(): CaptureStatus
|
||||
fun CapturedTypeConstructorMarker.projection(): TypeArgumentMarker
|
||||
|
||||
fun KotlinTypeMarker.argumentsCount(): Int
|
||||
fun KotlinTypeMarker.getArgument(index: Int): TypeArgumentMarker
|
||||
|
||||
|
||||
Reference in New Issue
Block a user