[FE] Check if type variable is fixed into an empty intersection type and report resolution warnings/errors if needed (completion stage)
^KT-51221 Fixed
This commit is contained in:
committed by
teamcity
parent
8e834fc7bb
commit
9e9e0211eb
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.types.model
|
||||
|
||||
import org.jetbrains.kotlin.types.AbstractTypeChecker
|
||||
import org.jetbrains.kotlin.types.TypeCheckerState
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
@@ -175,6 +176,18 @@ interface TypeSystemInferenceExtensionContext : TypeSystemContext, TypeSystemBui
|
||||
fun createStubTypeForBuilderInference(typeVariable: TypeVariableMarker): StubTypeMarker
|
||||
fun createStubTypeForTypeVariablesInSubtyping(typeVariable: TypeVariableMarker): StubTypeMarker
|
||||
|
||||
fun KotlinTypeMarker.isFinal(): Boolean
|
||||
|
||||
fun Collection<KotlinTypeMarker>.isEmptyIntersection(): Boolean =
|
||||
any { first ->
|
||||
any { second ->
|
||||
first !== second &&
|
||||
first.isFinal() &&
|
||||
second.typeConstructor().isClassTypeConstructor() &&
|
||||
!AbstractTypeChecker.isSubtypeOf(this@TypeSystemInferenceExtensionContext, first, second)
|
||||
}
|
||||
}
|
||||
|
||||
fun KotlinTypeMarker.removeAnnotations(): KotlinTypeMarker
|
||||
fun KotlinTypeMarker.removeExactAnnotation(): KotlinTypeMarker
|
||||
|
||||
|
||||
Reference in New Issue
Block a user