[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
return this
}
override fun TypeVariableMarker.isReified(): Boolean {
// TODO
return false
}
}
@@ -27,4 +27,9 @@ object ClassicConstraintSystemUtilContext : ConstraintSystemUtilContext {
require(this is KotlinType)
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.hasOnlyInputTypesAttribute(): Boolean
fun KotlinTypeMarker.unCapture(): KotlinTypeMarker
fun TypeVariableMarker.isReified(): Boolean
}
@@ -363,14 +363,13 @@ class NewConstraintSystemImpl(
// ResultTypeResolver.Context, VariableFixationFinder.Context
override fun isReified(variable: TypeVariableMarker): Boolean {
if (variable !is TypeVariableFromCallableDescriptor) return false
return variable.originalTypeParameter.isReified
return with(utilContext) { variable.isReified() }
}
override fun bindingStubsForPostponedVariables(): Map<TypeVariableMarker, StubTypeMarker> {
checkState(State.BUILDING, State.COMPLETION)
// 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 {