[NI] Get rid of FE 1.0 types in AbstractTypeApproximator
This commit is contained in:
@@ -23,10 +23,11 @@ import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.TypeIntersectionScope
|
||||
import org.jetbrains.kotlin.types.checker.KotlinTypeRefiner
|
||||
import org.jetbrains.kotlin.types.model.IntersectionTypeConstructorMarker
|
||||
import org.jetbrains.kotlin.types.refinement.TypeRefinement
|
||||
import java.util.*
|
||||
|
||||
class IntersectionTypeConstructor(typesToIntersect: Collection<KotlinType>) : TypeConstructor {
|
||||
class IntersectionTypeConstructor(typesToIntersect: Collection<KotlinType>) : TypeConstructor, IntersectionTypeConstructorMarker {
|
||||
private var alternative: KotlinType? = null
|
||||
|
||||
private constructor(
|
||||
|
||||
@@ -36,9 +36,6 @@ interface TypeSystemCommonBackendContext : TypeSystemContext {
|
||||
fun TypeParameterMarker.getRepresentativeUpperBound(): KotlinTypeMarker
|
||||
fun KotlinTypeMarker.getSubstitutedUnderlyingType(): KotlinTypeMarker?
|
||||
|
||||
fun KotlinTypeMarker.isMarkedNullable(): Boolean =
|
||||
this is SimpleTypeMarker && isMarkedNullable()
|
||||
|
||||
fun KotlinTypeMarker.makeNullable(): KotlinTypeMarker =
|
||||
asSimpleType()?.withNullability(true) ?: this
|
||||
|
||||
|
||||
+12
-1
@@ -6,8 +6,8 @@
|
||||
package org.jetbrains.kotlin.types.checker
|
||||
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.builtins.StandardNames.FqNames
|
||||
import org.jetbrains.kotlin.builtins.PrimitiveType
|
||||
import org.jetbrains.kotlin.builtins.StandardNames.FqNames
|
||||
import org.jetbrains.kotlin.builtins.isBuiltinFunctionalTypeOrSubtype
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
|
||||
@@ -31,6 +31,7 @@ import org.jetbrains.kotlin.types.typeUtil.representativeUpperBound
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
import org.jetbrains.kotlin.types.typeUtil.isSignedOrUnsignedNumberType as classicIsSignedOrUnsignedNumberType
|
||||
|
||||
interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSystemCommonBackendContext {
|
||||
override fun TypeConstructorMarker.isDenotable(): Boolean {
|
||||
@@ -517,6 +518,11 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy
|
||||
errorSupportedOnlyInTypeInference()
|
||||
}
|
||||
|
||||
override fun KotlinTypeMarker.isSpecial(): Boolean {
|
||||
require(this is KotlinType)
|
||||
return this is TypeUtils.SpecialType
|
||||
}
|
||||
|
||||
override fun TypeConstructorMarker.isTypeVariable(): Boolean {
|
||||
errorSupportedOnlyInTypeInference()
|
||||
}
|
||||
@@ -525,6 +531,11 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy
|
||||
errorSupportedOnlyInTypeInference()
|
||||
}
|
||||
|
||||
override fun KotlinTypeMarker.isSignedOrUnsignedNumberType(): Boolean {
|
||||
require(this is KotlinType)
|
||||
return classicIsSignedOrUnsignedNumberType()
|
||||
}
|
||||
|
||||
override fun findCommonIntegerLiteralTypesSuperType(explicitSupertypes: List<SimpleTypeMarker>): SimpleTypeMarker? {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
explicitSupertypes as List<SimpleType>
|
||||
|
||||
Reference in New Issue
Block a user