[NI] Get rid of left FE 1.0 types in NewConstraintSystemImpl

This commit is contained in:
Dmitriy Novozhilov
2020-08-26 13:29:06 +03:00
parent 6914aba5c2
commit ad039a28bd
4 changed files with 13 additions and 3 deletions
@@ -26,4 +26,9 @@ object ConeConstraintSystemUtilContext : ConstraintSystemUtilContext {
// TODO, see TypeUtils.kt // TODO, see TypeUtils.kt
return this return this
} }
override fun TypeVariableMarker.isReified(): Boolean {
// TODO
return false
}
} }
@@ -27,4 +27,9 @@ object ClassicConstraintSystemUtilContext : ConstraintSystemUtilContext {
require(this is KotlinType) require(this is KotlinType)
return unCaptureKotlinType().unwrap() return unCaptureKotlinType().unwrap()
} }
override fun TypeVariableMarker.isReified(): Boolean {
if (this !is TypeVariableFromCallableDescriptor) return false
return originalTypeParameter.isReified
}
} }
@@ -17,4 +17,5 @@ interface ConstraintSystemUtilContext {
fun TypeVariableMarker.shouldBeFlexible(): Boolean fun TypeVariableMarker.shouldBeFlexible(): Boolean
fun TypeVariableMarker.hasOnlyInputTypesAttribute(): Boolean fun TypeVariableMarker.hasOnlyInputTypesAttribute(): Boolean
fun KotlinTypeMarker.unCapture(): KotlinTypeMarker fun KotlinTypeMarker.unCapture(): KotlinTypeMarker
fun TypeVariableMarker.isReified(): Boolean
} }
@@ -363,14 +363,13 @@ class NewConstraintSystemImpl(
// ResultTypeResolver.Context, VariableFixationFinder.Context // ResultTypeResolver.Context, VariableFixationFinder.Context
override fun isReified(variable: TypeVariableMarker): Boolean { override fun isReified(variable: TypeVariableMarker): Boolean {
if (variable !is TypeVariableFromCallableDescriptor) return false return with(utilContext) { variable.isReified() }
return variable.originalTypeParameter.isReified
} }
override fun bindingStubsForPostponedVariables(): Map<TypeVariableMarker, StubTypeMarker> { override fun bindingStubsForPostponedVariables(): Map<TypeVariableMarker, StubTypeMarker> {
checkState(State.BUILDING, State.COMPLETION) checkState(State.BUILDING, State.COMPLETION)
// TODO: SUB // TODO: SUB
return storage.postponedTypeVariables.associate { it to createStubType(it)/*StubType(it.freshTypeConstructor() as TypeConstructor, it.defaultType().isMarkedNullable())*/ } return storage.postponedTypeVariables.associateWith { createStubType(it) }
} }
override fun currentStorage(): ConstraintStorage { override fun currentStorage(): ConstraintStorage {