FE: split one more test "buildList type argument is inferred into upper bound"

Related to KT-48445, KT-56169
This commit is contained in:
Mikhail Glukhikh
2023-03-14 12:46:49 +01:00
committed by Space Team
parent 97bec59bc9
commit 980ab41ef1
8 changed files with 180 additions and 28 deletions
@@ -36948,6 +36948,18 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundForbidden.kt");
}
@Test
@TestMetadata("buildListToUpperBoundInLazy.kt")
public void testBuildListToUpperBoundInLazy() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundInLazy.kt");
}
@Test
@TestMetadata("buildListToUpperBoundInLazyForbidden.kt")
public void testBuildListToUpperBoundInLazyForbidden() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundInLazyForbidden.kt");
}
@Test
@TestMetadata("completeIrrelevantCalls.kt")
public void testCompleteIrrelevantCalls() throws Exception {
@@ -36972,12 +36984,6 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/inferCoroutineTypeInOldVersion.kt");
}
@Test
@TestMetadata("kt48445.kt")
public void testKt48445() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/kt48445.kt");
}
@Test
@TestMetadata("resolveUsualCallWithBuilderInference.kt")
public void testResolveUsualCallWithBuilderInference() throws Exception {
@@ -36948,6 +36948,18 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundForbidden.kt");
}
@Test
@TestMetadata("buildListToUpperBoundInLazy.kt")
public void testBuildListToUpperBoundInLazy() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundInLazy.kt");
}
@Test
@TestMetadata("buildListToUpperBoundInLazyForbidden.kt")
public void testBuildListToUpperBoundInLazyForbidden() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundInLazyForbidden.kt");
}
@Test
@TestMetadata("completeIrrelevantCalls.kt")
public void testCompleteIrrelevantCalls() throws Exception {
@@ -36972,12 +36984,6 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/inferCoroutineTypeInOldVersion.kt");
}
@Test
@TestMetadata("kt48445.kt")
public void testKt48445() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/kt48445.kt");
}
@Test
@TestMetadata("resolveUsualCallWithBuilderInference.kt")
public void testResolveUsualCallWithBuilderInference() throws Exception {
@@ -37044,6 +37044,18 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundForbidden.kt");
}
@Test
@TestMetadata("buildListToUpperBoundInLazy.kt")
public void testBuildListToUpperBoundInLazy() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundInLazy.kt");
}
@Test
@TestMetadata("buildListToUpperBoundInLazyForbidden.kt")
public void testBuildListToUpperBoundInLazyForbidden() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundInLazyForbidden.kt");
}
@Test
@TestMetadata("completeIrrelevantCalls.kt")
public void testCompleteIrrelevantCalls() throws Exception {
@@ -37068,12 +37080,6 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/inferCoroutineTypeInOldVersion.kt");
}
@Test
@TestMetadata("kt48445.kt")
public void testKt48445() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/kt48445.kt");
}
@Test
@TestMetadata("resolveUsualCallWithBuilderInference.kt")
public void testResolveUsualCallWithBuilderInference() throws Exception {
@@ -0,0 +1,64 @@
// !LANGUAGE: +UnrestrictedBuilderInference -ForbidInferringPostponedTypeVariableIntoDeclaredUpperBound
// ISSUE: KT-48445
internal class TowerDataElementsForName() {
val reversedFilteredLocalScopes by lazy(LazyThreadSafetyMode.NONE) {
@OptIn(ExperimentalStdlibApi::class)
buildList {
for (i in lastIndex downTo 0) {
add("")
}
}
}
}
internal class TowerDataElementsForName2() {
@OptIn(ExperimentalStdlibApi::class)
val reversedFilteredLocalScopes = buildList {
val reversedFilteredLocalScopes by lazy(LazyThreadSafetyMode.NONE) {
@OptIn(ExperimentalStdlibApi::class)
buildList {
for (i in lastIndex downTo 0) {
add("")
}
}
}
add(reversedFilteredLocalScopes)
}
}
internal class TowerDataElementsForName3() {
val reversedFilteredLocalScopes by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>lazy<!>(LazyThreadSafetyMode.NONE) {
@OptIn(ExperimentalStdlibApi::class)
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildList<!> l1@ {
for (i in lastIndex downTo 0) {
val reversedFilteredLocalScopes by lazy(LazyThreadSafetyMode.NONE) {
@OptIn(ExperimentalStdlibApi::class)
buildList {
for (i in lastIndex downTo 0) {
add("")
this@l1.add("")
}
}
}
}
}
}
}
internal class TowerDataElementsForName4() {
@OptIn(ExperimentalStdlibApi::class)
val reversedFilteredLocalScopes = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildList<!> l1@ {
class Foo {
val reversedFilteredLocalScopes by lazy(LazyThreadSafetyMode.NONE) {
@OptIn(ExperimentalStdlibApi::class)
buildList {
for (i in lastIndex downTo 0) {
add("")
this@l1.add("")
}
}
}
}
}
}
@@ -0,0 +1,64 @@
// !LANGUAGE: +UnrestrictedBuilderInference -ForbidInferringPostponedTypeVariableIntoDeclaredUpperBound
// ISSUE: KT-48445
internal class TowerDataElementsForName() {
val reversedFilteredLocalScopes by lazy(LazyThreadSafetyMode.NONE) {
@OptIn(ExperimentalStdlibApi::class)
buildList {
for (i in lastIndex downTo 0) {
add("")
}
}
}
}
internal class TowerDataElementsForName2() {
@OptIn(ExperimentalStdlibApi::class)
val reversedFilteredLocalScopes = buildList {
val reversedFilteredLocalScopes by lazy(LazyThreadSafetyMode.NONE) {
@OptIn(ExperimentalStdlibApi::class)
buildList {
for (i in lastIndex downTo 0) {
add("")
}
}
}
add(reversedFilteredLocalScopes)
}
}
internal class TowerDataElementsForName3() {
val reversedFilteredLocalScopes by lazy(LazyThreadSafetyMode.NONE) {
@OptIn(ExperimentalStdlibApi::class)
buildList l1@ {
for (i in lastIndex downTo 0) {
val reversedFilteredLocalScopes by lazy(LazyThreadSafetyMode.NONE) {
@OptIn(ExperimentalStdlibApi::class)
buildList {
for (<!NAME_SHADOWING!>i<!> in lastIndex downTo 0) {
add("")
this@l1.add("")
}
}
}
}
}
}
}
internal class TowerDataElementsForName4() {
@OptIn(ExperimentalStdlibApi::class)
val reversedFilteredLocalScopes = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildList<!> l1@ {
class Foo {
val reversedFilteredLocalScopes by lazy(LazyThreadSafetyMode.NONE) {
@OptIn(ExperimentalStdlibApi::class)
buildList {
for (i in lastIndex downTo 0) {
add("")
this@l1.add("")
}
}
}
}
}
}
@@ -1,5 +1,5 @@
// !LANGUAGE: +UnrestrictedBuilderInference
// SKIP_TXT
// !LANGUAGE: +UnrestrictedBuilderInference +ForbidInferringPostponedTypeVariableIntoDeclaredUpperBound
// ISSUE: KT-56169
internal class TowerDataElementsForName() {
val reversedFilteredLocalScopes by lazy(LazyThreadSafetyMode.NONE) {
@@ -1,5 +1,5 @@
// !LANGUAGE: +UnrestrictedBuilderInference
// SKIP_TXT
// !LANGUAGE: +UnrestrictedBuilderInference +ForbidInferringPostponedTypeVariableIntoDeclaredUpperBound
// ISSUE: KT-56169
internal class TowerDataElementsForName() {
val reversedFilteredLocalScopes by lazy(LazyThreadSafetyMode.NONE) {
@@ -37044,6 +37044,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundForbidden.kt");
}
@Test
@TestMetadata("buildListToUpperBoundInLazy.kt")
public void testBuildListToUpperBoundInLazy() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundInLazy.kt");
}
@Test
@TestMetadata("buildListToUpperBoundInLazyForbidden.kt")
public void testBuildListToUpperBoundInLazyForbidden() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundInLazyForbidden.kt");
}
@Test
@TestMetadata("completeIrrelevantCalls.kt")
public void testCompleteIrrelevantCalls() throws Exception {
@@ -37068,12 +37080,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/inferCoroutineTypeInOldVersion.kt");
}
@Test
@TestMetadata("kt48445.kt")
public void testKt48445() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/kt48445.kt");
}
@Test
@TestMetadata("resolveUsualCallWithBuilderInference.kt")
public void testResolveUsualCallWithBuilderInference() throws Exception {