Fix SOE when recursive type argument is used with star projection
#KT-41043 Fixed
This commit is contained in:
Generated
+5
@@ -12657,6 +12657,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("recursiveConstraintInsideTypeArgumentWithStarProjection.kt")
|
||||||
|
public void testRecursiveConstraintInsideTypeArgumentWithStarProjection() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inference/recursiveConstraintInsideTypeArgumentWithStarProjection.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("referenceToCatchParameterFromLambdaExpression.kt")
|
@TestMetadata("referenceToCatchParameterFromLambdaExpression.kt")
|
||||||
public void testReferenceToCatchParameterFromLambdaExpression() throws Exception {
|
public void testReferenceToCatchParameterFromLambdaExpression() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
||||||
|
|||||||
+3
-1
@@ -403,7 +403,9 @@ class PostponedArgumentInputTypesResolver(
|
|||||||
listOf(typeConstructor) + relatedVariables.filterIsInstance<TypeVariableTypeConstructor>()
|
listOf(typeConstructor) + relatedVariables.filterIsInstance<TypeVariableTypeConstructor>()
|
||||||
}
|
}
|
||||||
type.arguments.isNotEmpty() -> {
|
type.arguments.isNotEmpty() -> {
|
||||||
type.arguments.flatMap { getAllDeeplyRelatedTypeVariables(it.type, variableDependencyProvider) }
|
type.arguments.flatMap {
|
||||||
|
if (it.isStarProjection) emptyList() else getAllDeeplyRelatedTypeVariables(it.type, variableDependencyProvider)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else -> emptyList()
|
else -> emptyList()
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+15
@@ -0,0 +1,15 @@
|
|||||||
|
class Foo<out T>(val key: T)
|
||||||
|
class Bar()
|
||||||
|
|
||||||
|
class KFlowable<T> {
|
||||||
|
fun <R> scan(initial: R, accumulator: (R, T) -> R) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(k: KFlowable<Foo<Enum<*>>>) {
|
||||||
|
k.scan(Bar()) { s, t -> Bar() }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
test(KFlowable())
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
+5
@@ -13882,6 +13882,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("recursiveConstraintInsideTypeArgumentWithStarProjection.kt")
|
||||||
|
public void testRecursiveConstraintInsideTypeArgumentWithStarProjection() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inference/recursiveConstraintInsideTypeArgumentWithStarProjection.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("referenceToCatchParameterFromLambdaExpression.kt")
|
@TestMetadata("referenceToCatchParameterFromLambdaExpression.kt")
|
||||||
public void testReferenceToCatchParameterFromLambdaExpression() throws Exception {
|
public void testReferenceToCatchParameterFromLambdaExpression() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
||||||
|
|||||||
+5
@@ -13882,6 +13882,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("recursiveConstraintInsideTypeArgumentWithStarProjection.kt")
|
||||||
|
public void testRecursiveConstraintInsideTypeArgumentWithStarProjection() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inference/recursiveConstraintInsideTypeArgumentWithStarProjection.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("referenceToCatchParameterFromLambdaExpression.kt")
|
@TestMetadata("referenceToCatchParameterFromLambdaExpression.kt")
|
||||||
public void testReferenceToCatchParameterFromLambdaExpression() throws Exception {
|
public void testReferenceToCatchParameterFromLambdaExpression() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
||||||
|
|||||||
+5
@@ -12657,6 +12657,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("recursiveConstraintInsideTypeArgumentWithStarProjection.kt")
|
||||||
|
public void testRecursiveConstraintInsideTypeArgumentWithStarProjection() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inference/recursiveConstraintInsideTypeArgumentWithStarProjection.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("referenceToCatchParameterFromLambdaExpression.kt")
|
@TestMetadata("referenceToCatchParameterFromLambdaExpression.kt")
|
||||||
public void testReferenceToCatchParameterFromLambdaExpression() throws Exception {
|
public void testReferenceToCatchParameterFromLambdaExpression() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
||||||
|
|||||||
Generated
+5
@@ -10827,6 +10827,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
|||||||
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("recursiveConstraintInsideTypeArgumentWithStarProjection.kt")
|
||||||
|
public void testRecursiveConstraintInsideTypeArgumentWithStarProjection() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inference/recursiveConstraintInsideTypeArgumentWithStarProjection.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("referenceToCatchParameterFromLambdaExpression.kt")
|
@TestMetadata("referenceToCatchParameterFromLambdaExpression.kt")
|
||||||
public void testReferenceToCatchParameterFromLambdaExpression() throws Exception {
|
public void testReferenceToCatchParameterFromLambdaExpression() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
||||||
|
|||||||
Generated
+5
@@ -10827,6 +10827,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("recursiveConstraintInsideTypeArgumentWithStarProjection.kt")
|
||||||
|
public void testRecursiveConstraintInsideTypeArgumentWithStarProjection() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inference/recursiveConstraintInsideTypeArgumentWithStarProjection.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("referenceToCatchParameterFromLambdaExpression.kt")
|
@TestMetadata("referenceToCatchParameterFromLambdaExpression.kt")
|
||||||
public void testReferenceToCatchParameterFromLambdaExpression() throws Exception {
|
public void testReferenceToCatchParameterFromLambdaExpression() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
||||||
|
|||||||
+5
@@ -10892,6 +10892,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("recursiveConstraintInsideTypeArgumentWithStarProjection.kt")
|
||||||
|
public void testRecursiveConstraintInsideTypeArgumentWithStarProjection() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inference/recursiveConstraintInsideTypeArgumentWithStarProjection.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("referenceToCatchParameterFromLambdaExpression.kt")
|
@TestMetadata("referenceToCatchParameterFromLambdaExpression.kt")
|
||||||
public void testReferenceToCatchParameterFromLambdaExpression() throws Exception {
|
public void testReferenceToCatchParameterFromLambdaExpression() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user