Fix creating of refined FlexibleType and RawType

There was an issue that `KotlinType.equals` called in `KotlinTypeFactory.flexibleType`
  and `RawType` constructor produced endless recursion of types that wasn't
  computed yet
This commit is contained in:
Dmitriy Novozhilov
2019-06-17 15:23:12 +03:00
committed by Dmitry Savvinov
parent 33a31fb688
commit b477184a3c
2 changed files with 18 additions and 7 deletions
@@ -139,9 +139,10 @@ class FlexibleTypeImpl(lowerBound: SimpleType, upperBound: SimpleType) : Flexibl
@TypeRefinement
@UseExperimental(TypeRefinement::class)
override fun refine(kotlinTypeRefiner: KotlinTypeRefiner) =
KotlinTypeFactory.flexibleType(
override fun refine(kotlinTypeRefiner: KotlinTypeRefiner): FlexibleType {
return FlexibleTypeImpl(
kotlinTypeRefiner.refineType(lowerBound) as SimpleType,
kotlinTypeRefiner.refineType(upperBound) as SimpleType
) as FlexibleType
)
}
}