Enhance bounds for type parameters after loops disconnection
Otherwise behavior might change because enhancement may force computation
for other type parameters in cases like:
class A<X extends Y, Y extends X> {}
See the test:
org.jetbrains.kotlin.checkers.DiagnosticsTestGenerated.Tests.J_k#testRecursiveRawUpperBound3
This commit is contained in:
committed by
Victor Petukhov
parent
6661814e40
commit
59bd7364ab
+5
-1
@@ -45,7 +45,7 @@ class LazyJavaTypeParameterDescriptor(
|
||||
override val annotations = LazyJavaAnnotations(c, javaTypeParameter)
|
||||
|
||||
override fun resolveUpperBounds(): List<KotlinType> {
|
||||
return computeNotEnhancedBounds().let { c.components.signatureEnhancement.enhanceTypeParameterBounds(this, it, c) }
|
||||
return computeNotEnhancedBounds()
|
||||
}
|
||||
|
||||
private fun computeNotEnhancedBounds(): List<KotlinType> {
|
||||
@@ -63,6 +63,10 @@ class LazyJavaTypeParameterDescriptor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun processBoundsWithoutCycles(bounds: List<KotlinType>): List<KotlinType> {
|
||||
return c.components.signatureEnhancement.enhanceTypeParameterBounds(this, bounds, c)
|
||||
}
|
||||
|
||||
override fun reportSupertypeLoopError(type: KotlinType) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user