FE: do not wrap types with enhancements if they're the same

This commit is contained in:
pyos
2021-07-27 09:39:44 +02:00
committed by Victor Petukhov
parent 8c524c2f89
commit c401582770
12 changed files with 211 additions and 1 deletions
@@ -159,7 +159,7 @@ fun UnwrappedType.wrapEnhancement(enhancement: KotlinType?): UnwrappedType {
if (this is TypeWithEnhancement) {
return origin.wrapEnhancement(enhancement)
}
if (enhancement == null) {
if (enhancement == null || enhancement == this) {
return this
}
return when (this) {