[FIR] Return error type from common super type if it present
This commit is contained in:
@@ -30,6 +30,8 @@ import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
|
||||
interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSystemCommonBackendContext {
|
||||
override val isErrorTypeAllowed: Boolean get() = true
|
||||
|
||||
override fun TypeConstructorMarker.isDenotable(): Boolean {
|
||||
require(this is TypeConstructor, this::errorMessage)
|
||||
return this.isDenotable
|
||||
@@ -56,6 +58,10 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy
|
||||
return this.isError
|
||||
}
|
||||
|
||||
override fun TypeConstructorMarker.toErrorType(): SimpleTypeMarker {
|
||||
throw IllegalStateException("Should not be called")
|
||||
}
|
||||
|
||||
override fun KotlinTypeMarker.isUninferredParameter(): Boolean {
|
||||
require(this is KotlinType, this::errorMessage)
|
||||
return ErrorUtils.isUninferredParameter(this)
|
||||
@@ -469,6 +475,10 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy
|
||||
return IntegerLiteralTypeConstructor.findCommonSuperType(explicitSupertypes)
|
||||
}
|
||||
|
||||
override fun TypeConstructorMarker.isError(): Boolean {
|
||||
throw IllegalStateException("Should not be called")
|
||||
}
|
||||
|
||||
override fun TypeConstructorMarker.getApproximatedIntegerLiteralType(): KotlinTypeMarker {
|
||||
require(this is IntegerLiteralTypeConstructor, this::errorMessage)
|
||||
return this.getApproximatedType().unwrap()
|
||||
|
||||
Reference in New Issue
Block a user