FIR: Refine operations over OriginalProjectionTypeAttribute

It's necessary because during substitution it might be necessary to combine
attributes from the original type (this) and substitution
where OriginalProjectionTypeAttribute is actually expected to be null.

Probably, it's worth considering some kind of assertion
that `other` is always null or their projections are the same.
This commit is contained in:
Denis.Zharkov
2022-04-21 10:35:05 +03:00
committed by teamcity
parent f70ae2df3a
commit 8a742b2574
@@ -129,17 +129,9 @@ private class FE10LikeConeSubstitutor(
}
private class OriginalProjectionTypeAttribute(val data: ConeTypeProjection) : ConeAttribute<OriginalProjectionTypeAttribute>() {
override fun union(other: OriginalProjectionTypeAttribute?): OriginalProjectionTypeAttribute? {
return other
}
override fun intersect(other: OriginalProjectionTypeAttribute?): OriginalProjectionTypeAttribute? {
return other
}
override fun add(other: OriginalProjectionTypeAttribute?): OriginalProjectionTypeAttribute? {
return other
}
override fun union(other: OriginalProjectionTypeAttribute?): OriginalProjectionTypeAttribute = other ?: this
override fun intersect(other: OriginalProjectionTypeAttribute?): OriginalProjectionTypeAttribute = other ?: this
override fun add(other: OriginalProjectionTypeAttribute?): OriginalProjectionTypeAttribute = other ?: this
override fun isSubtypeOf(other: OriginalProjectionTypeAttribute?): Boolean {
return true