[FIR] Make ConeTypeCheckerContext implements ConeInferenceContext
This commit is contained in:
+19
@@ -298,4 +298,23 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext,
|
|||||||
override fun TypeConstructorMarker.isCapturedTypeConstructor(): Boolean {
|
override fun TypeConstructorMarker.isCapturedTypeConstructor(): Boolean {
|
||||||
return this is ConeCapturedTypeConstructor
|
return this is ConeCapturedTypeConstructor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun TypeConstructorMarker.getApproximatedIntegerLiteralType(): KotlinTypeMarker {
|
||||||
|
TODO()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun KotlinTypeMarker.removeExactAnnotation(): KotlinTypeMarker {
|
||||||
|
// TODO
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun TypeConstructorMarker.toErrorType(): SimpleTypeMarker {
|
||||||
|
require(this is ErrorTypeConstructor)
|
||||||
|
return ConeClassErrorType(reason)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun findCommonIntegerLiteralTypesSuperType(explicitSupertypes: List<SimpleTypeMarker>): SimpleTypeMarker? {
|
||||||
|
// TODO: implement
|
||||||
|
return null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-18
@@ -43,26 +43,8 @@ internal interface UniversalConeInferenceContext :
|
|||||||
internal fun FirSession.inferenceContext(): UniversalConeInferenceContext {
|
internal fun FirSession.inferenceContext(): UniversalConeInferenceContext {
|
||||||
val session = this
|
val session = this
|
||||||
return object : UniversalConeInferenceContext {
|
return object : UniversalConeInferenceContext {
|
||||||
override fun findCommonIntegerLiteralTypesSuperType(explicitSupertypes: List<SimpleTypeMarker>): SimpleTypeMarker? {
|
|
||||||
// TODO: implement
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun TypeConstructorMarker.getApproximatedIntegerLiteralType(): KotlinTypeMarker {
|
|
||||||
TODO("not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override val session: FirSession
|
override val session: FirSession
|
||||||
get() = session
|
get() = session
|
||||||
|
|
||||||
override fun KotlinTypeMarker.removeExactAnnotation(): KotlinTypeMarker {
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun TypeConstructorMarker.toErrorType(): SimpleTypeMarker {
|
|
||||||
require(this is ErrorTypeConstructor)
|
|
||||||
return ConeClassErrorType(reason)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -496,7 +496,7 @@ class ConeTypeCheckerContext(
|
|||||||
override val isErrorTypeEqualsToAnything: Boolean,
|
override val isErrorTypeEqualsToAnything: Boolean,
|
||||||
override val isStubTypeEqualsToAnything: Boolean,
|
override val isStubTypeEqualsToAnything: Boolean,
|
||||||
override val session: FirSession
|
override val session: FirSession
|
||||||
) : AbstractTypeCheckerContext(), ConeTypeContext {
|
) : AbstractTypeCheckerContext(), ConeInferenceContext {
|
||||||
override fun substitutionSupertypePolicy(type: SimpleTypeMarker): SupertypesPolicy {
|
override fun substitutionSupertypePolicy(type: SimpleTypeMarker): SupertypesPolicy {
|
||||||
if (type.argumentsCount() == 0) return SupertypesPolicy.LowerIfFlexible
|
if (type.argumentsCount() == 0) return SupertypesPolicy.LowerIfFlexible
|
||||||
require(type is ConeKotlinType)
|
require(type is ConeKotlinType)
|
||||||
@@ -530,7 +530,7 @@ class ConeTypeCheckerContext(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun prepareType(type: KotlinTypeMarker): KotlinTypeMarker {
|
override fun prepareType(type: KotlinTypeMarker): KotlinTypeMarker {
|
||||||
return super<ConeTypeContext>.prepareType(type)
|
return super<ConeInferenceContext>.prepareType(type)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun refineType(type: KotlinTypeMarker): KotlinTypeMarker {
|
override fun refineType(type: KotlinTypeMarker): KotlinTypeMarker {
|
||||||
|
|||||||
Reference in New Issue
Block a user