FIR: add original test from KT-49925 (passes)

This commit is contained in:
Mikhail Glukhikh
2021-12-21 13:20:43 +03:00
committed by teamcity
parent 2f32214106
commit dde4c46df7
5 changed files with 42 additions and 0 deletions
@@ -5136,6 +5136,12 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@Test
@TestMetadata("buildList.kt")
public void testBuildList() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/problems/buildList.kt");
}
@Test
@TestMetadata("expectedType.kt")
public void testExpectedType() throws Exception {
@@ -0,0 +1,19 @@
FILE: buildList.kt
public final class Wrapper : R|kotlin/Any| {
public constructor(tag: R|kotlin/String|): R|Wrapper| {
super<R|kotlin/Any|>()
}
public final val tag: R|kotlin/String| = R|<local>/tag|
public get(): R|kotlin/String|
}
public final fun foo(wrappers: R|kotlin/collections/List<Wrapper>|): R|kotlin/collections/List<kotlin/String>| {
^foo R|kotlin/collections/buildList|<R|kotlin/String|>(<L> = buildList@fun R|kotlin/collections/MutableList<kotlin/String>|.<anonymous>(): R|kotlin/Unit| <inline=Inline, kind=EXACTLY_ONCE> {
R|<local>/wrappers|.R|kotlin/collections/mapTo|<R|Wrapper|, R|kotlin/String|, R|kotlin/collections/MutableList<kotlin/String>|>(this@R|special/anonymous|, <L> = mapTo@fun <anonymous>(it: R|Wrapper|): R|kotlin/String| <inline=Inline, kind=UNKNOWN> {
^ R|<local>/it|.R|/Wrapper.tag|
}
)
}
)
}
@@ -0,0 +1,5 @@
class Wrapper(val tag: String)
fun foo(wrappers: List<Wrapper>) = buildList {
wrappers.mapTo(this) { it.tag }
}
@@ -5136,6 +5136,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@Test
@TestMetadata("buildList.kt")
public void testBuildList() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/problems/buildList.kt");
}
@Test
@TestMetadata("expectedType.kt")
public void testExpectedType() throws Exception {
@@ -5136,6 +5136,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@Test
@TestMetadata("buildList.kt")
public void testBuildList() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/problems/buildList.kt");
}
@Test
@TestMetadata("expectedType.kt")
public void testExpectedType() throws Exception {