[NI] Refactor compiler representation of integer literals types
Add `IntegerLiteralTypeConstructor` that holds types, that can take integer literal with given value. It has two supertypes (`Number` and `Comparable<IntegerLiteralType>`) and have special rules for subtyping, `intersect` and `commonSuperType` functions with primitive number: Example (assuming that ILT holds Int type): * ILT <: Int * Int :> ILT * ILT intersect Int = Int * commonSuperType(ILT, Int) = Int #KT-30293 Fixed #KT-30446 Fixed
This commit is contained in:
@@ -34,6 +34,15 @@ class ErrorTypeConstructor(reason: String) : TypeConstructorMarker
|
||||
interface ConeTypeContext : TypeSystemContext, TypeSystemOptimizationContext {
|
||||
val session: FirSession
|
||||
|
||||
override fun TypeConstructorMarker.isIntegerLiteralTypeConstructor(): Boolean {
|
||||
// TODO()
|
||||
return false
|
||||
}
|
||||
|
||||
override fun SimpleTypeMarker.possibleIntegerTypes(): Collection<KotlinTypeMarker> {
|
||||
TODO("not implemented")
|
||||
}
|
||||
|
||||
override fun KotlinTypeMarker.asSimpleType(): SimpleTypeMarker? {
|
||||
assert(this is ConeKotlinType)
|
||||
return when (this) {
|
||||
|
||||
Reference in New Issue
Block a user