[FIR] Never create ConeSubstitutorByMap with empty substitution
Relates to KT-66323
This commit is contained in:
committed by
Space Team
parent
6c691b497a
commit
624bea3ecf
+6
@@ -6,11 +6,13 @@
|
||||
package org.jetbrains.kotlin.fir.resolve.substitution
|
||||
|
||||
import org.jetbrains.kotlin.fir.types.ConeKotlinType
|
||||
import org.jetbrains.kotlin.fir.types.ConeTypeProjection
|
||||
import org.jetbrains.kotlin.types.model.TypeSubstitutorMarker
|
||||
|
||||
abstract class ConeSubstitutor : TypeSubstitutorMarker {
|
||||
open fun substituteOrSelf(type: ConeKotlinType): ConeKotlinType = substituteOrNull(type) ?: type
|
||||
abstract fun substituteOrNull(type: ConeKotlinType): ConeKotlinType?
|
||||
abstract fun substituteArgument(projection: ConeTypeProjection, index: Int): ConeTypeProjection?
|
||||
|
||||
object Empty : ConeSubstitutor() {
|
||||
override fun substituteOrSelf(type: ConeKotlinType): ConeKotlinType {
|
||||
@@ -21,6 +23,10 @@ abstract class ConeSubstitutor : TypeSubstitutorMarker {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun substituteArgument(projection: ConeTypeProjection, index: Int): ConeTypeProjection? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun toString(): String = "Empty"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user