[Inference] Add ability to approximate local types in AbstractTypeApproximator

This commit is contained in:
Dmitriy Novozhilov
2021-02-18 17:27:02 +03:00
committed by TeamCityServer
parent 73616107b4
commit 3626008ed2
6 changed files with 38 additions and 11 deletions
@@ -269,6 +269,11 @@ interface IrTypeSystemContext : TypeSystemContext, TypeSystemCommonSuperTypesCon
override fun TypeConstructorMarker.isIntegerLiteralTypeConstructor() = false
override fun TypeConstructorMarker.isLocalType(): Boolean {
if (this !is IrClassSymbol) return false
return this.owner.classId?.isLocal == true
}
override fun createFlexibleType(lowerBound: SimpleTypeMarker, upperBound: SimpleTypeMarker): KotlinTypeMarker {
require(lowerBound.isNothing())
require(upperBound is IrType && upperBound.isNullableAny())
@@ -516,4 +521,4 @@ fun extractTypeParameters(parent: IrDeclarationParent): List<IrTypeParameter> {
}
class IrTypeSystemContextImpl(override val irBuiltIns: IrBuiltIns) : IrTypeSystemContext
class IrTypeSystemContextImpl(override val irBuiltIns: IrBuiltIns) : IrTypeSystemContext