[FE] Review fixes

This commit is contained in:
Victor Petukhov
2022-04-18 12:07:27 +03:00
committed by teamcity
parent c71ae4301c
commit e0a1f1c405
24 changed files with 60 additions and 75 deletions
@@ -107,7 +107,7 @@ abstract class ConstraintSystemCompletionContext : VariableFixationFinder.Contex
postponedArguments: List<T>
) = postponedArguments.firstOrNull { argument -> argument.inputTypes.all { containsOnlyFixedVariables(it) } }
fun List<Constraint>.extractUpperTypes(): List<KotlinTypeMarker> =
fun List<Constraint>.extractUpperTypesToCheckIntersectionEmptiness(): List<KotlinTypeMarker> =
filter { constraint ->
constraint.kind == ConstraintKind.UPPER && !constraint.type.contains {
!it.typeConstructor().isClassTypeConstructor() && !it.typeConstructor().isTypeParameterTypeConstructor()
@@ -113,7 +113,7 @@ class NewConstraintWarning(
override val lowerType: KotlinTypeMarker,
override val upperType: KotlinTypeMarker,
override val position: IncorporationConstraintPosition,
) : ConstraintSystemError(RESOLVED_WITH_WARNING), NewConstraintMismatch
) : ConstraintSystemError(RESOLVED), NewConstraintMismatch
class CapturedTypeFromSubtyping(
val typeVariable: TypeVariableMarker,
@@ -143,7 +143,7 @@ sealed interface InferredEmptyIntersection {
class InferredEmptyIntersectionWarning(
override val incompatibleTypes: Collection<KotlinTypeMarker>,
override val typeVariable: TypeVariableMarker
) : ConstraintSystemError(RESOLVED_WITH_WARNING), InferredEmptyIntersection
) : ConstraintSystemError(RESOLVED), InferredEmptyIntersection
class InferredEmptyIntersectionError(
override val incompatibleTypes: Collection<KotlinTypeMarker>,
@@ -29,7 +29,6 @@ enum class CandidateApplicability {
PROPERTY_AS_OPERATOR, // using property of functional type as an operator. From resolution perspective, this is considered successful.
RESOLVED_NEED_PRESERVE_COMPATIBILITY, // call resolved successfully, but using new features that changes resolve
RESOLVED_WITH_ERROR, // call has error, but it is still successful from resolution perspective
RESOLVED_WITH_WARNING, // generally call is successful, but there are additional resolution warnings (e.g. for deprecation something)
RESOLVED, // call success or has uncompleted inference or in other words possible successful candidate
}