AA FE1.0: Fix StackOverflowError during resolution to a function w/ recursive type parameter
^KT-55825 Fixed
This commit is contained in:
committed by
Yan Zhulanow
parent
0c516f8483
commit
2dca2b4827
+6
-1
@@ -231,7 +231,12 @@ private fun KotlinType.hasReferenceOtherThan(allowedTypeParameterDescriptors: Se
|
||||
declarationDescriptor !in allowedTypeParameterDescriptors ||
|
||||
declarationDescriptor.upperBounds.any { it.hasReferenceOtherThan(allowedTypeParameterDescriptors) }
|
||||
}
|
||||
else -> arguments.any { it.type.hasReferenceOtherThan(allowedTypeParameterDescriptors) }
|
||||
else -> arguments.any { typeProjection ->
|
||||
// A star projection type (lazily) built by type parameter will be yet another type with a star projection,
|
||||
// resulting in stack overflow if we keep checking allowed type parameter descriptors
|
||||
!typeProjection.isStarProjection &&
|
||||
typeProjection.type.hasReferenceOtherThan(allowedTypeParameterDescriptors)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
@@ -700,6 +700,12 @@ public class Fe10IdeNormalAnalysisSourceModuleResolveCallTestGenerated extends A
|
||||
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/qualifiedCalleeExpressionOfImplicitInvoke.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("recursiveTypeParameter.kt")
|
||||
public void testRecursiveTypeParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/recursiveTypeParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("resolveCallInSuperConstructorParam.kt")
|
||||
public void testResolveCallInSuperConstructorParam() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user