FIR: Fix inference case with flexible captured types
Previsously, errors have been ignored because we ignored errors raised from the completion phase See the comment above the createConstraintPartForLowerBoundAndFlexibleTypeVariable
This commit is contained in:
committed by
teamcityserver
parent
c758069d7c
commit
faa5e46396
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.types.model
|
||||
|
||||
import org.jetbrains.kotlin.types.AbstractTypeCheckerContext
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
import kotlin.collections.ArrayList
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
|
||||
@@ -238,6 +237,17 @@ interface TypeSystemInferenceExtensionContext : TypeSystemContext, TypeSystemBui
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
fun KotlinTypeMarker.extractTypeVariables() = buildSet { extractTypeVariables(this) }
|
||||
|
||||
/**
|
||||
* For case Foo <: (T..T?) return LowerBound for new constraint LowerBound <: T
|
||||
* In FE 1.0, in case nullable it was just Foo?, so constraint was Foo? <: T
|
||||
* But it's not 100% correct because prevent having not-nullable upper constraint on T while initial (Foo? <: (T..T?)) is not violated
|
||||
*
|
||||
* In FIR, we try to have a correct one: (Foo!!..Foo?) <: T
|
||||
*
|
||||
* In future once we have only FIR (or FE 1.0 behavior is fixed) this method should be inlined to the use-site
|
||||
*/
|
||||
fun SimpleTypeMarker.createConstraintPartForLowerBoundAndFlexibleTypeVariable(): KotlinTypeMarker
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user