K2: reproduce KT-58379
This commit is contained in:
committed by
Space Team
parent
142e2b4b2a
commit
6ae648f6f6
+6
@@ -19320,6 +19320,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/integerLiterals/literalsInInference.kt");
|
runTest("compiler/testData/diagnostics/tests/integerLiterals/literalsInInference.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sortedBy.kt")
|
||||||
|
public void testSortedBy() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/integerLiterals/sortedBy.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("typealiasOnLong.kt")
|
@TestMetadata("typealiasOnLong.kt")
|
||||||
public void testTypealiasOnLong() throws Exception {
|
public void testTypealiasOnLong() throws Exception {
|
||||||
|
|||||||
+6
@@ -19320,6 +19320,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/integerLiterals/literalsInInference.kt");
|
runTest("compiler/testData/diagnostics/tests/integerLiterals/literalsInInference.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sortedBy.kt")
|
||||||
|
public void testSortedBy() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/integerLiterals/sortedBy.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("typealiasOnLong.kt")
|
@TestMetadata("typealiasOnLong.kt")
|
||||||
public void testTypealiasOnLong() throws Exception {
|
public void testTypealiasOnLong() throws Exception {
|
||||||
|
|||||||
+6
@@ -19320,6 +19320,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/tests/integerLiterals/literalsInInference.kt");
|
runTest("compiler/testData/diagnostics/tests/integerLiterals/literalsInInference.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sortedBy.kt")
|
||||||
|
public void testSortedBy() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/integerLiterals/sortedBy.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("typealiasOnLong.kt")
|
@TestMetadata("typealiasOnLong.kt")
|
||||||
public void testTypealiasOnLong() throws Exception {
|
public void testTypealiasOnLong() throws Exception {
|
||||||
|
|||||||
+6
@@ -19326,6 +19326,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/integerLiterals/literalsInInference.kt");
|
runTest("compiler/testData/diagnostics/tests/integerLiterals/literalsInInference.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sortedBy.kt")
|
||||||
|
public void testSortedBy() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/integerLiterals/sortedBy.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("typealiasOnLong.kt")
|
@TestMetadata("typealiasOnLong.kt")
|
||||||
public void testTypealiasOnLong() throws Exception {
|
public void testTypealiasOnLong() throws Exception {
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
import Cause.*
|
||||||
|
|
||||||
|
typealias ChallengeFunction = suspend (String) -> Unit
|
||||||
|
|
||||||
|
enum class Cause {
|
||||||
|
FIRST,
|
||||||
|
SECOND,
|
||||||
|
ERROR,
|
||||||
|
LAST
|
||||||
|
}
|
||||||
|
|
||||||
|
class Some {
|
||||||
|
internal val register = mutableListOf<Pair<Cause, ChallengeFunction>>()
|
||||||
|
|
||||||
|
internal val challenges: List<ChallengeFunction>
|
||||||
|
get() = <!NEW_INFERENCE_ERROR!>register.filter { it.first != ERROR }.sortedBy {
|
||||||
|
when (it.first) {
|
||||||
|
FIRST -> 1
|
||||||
|
SECOND -> 2
|
||||||
|
else -> throw AssertionError()
|
||||||
|
}
|
||||||
|
}<!>.map { it.second }
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
import Cause.*
|
||||||
|
|
||||||
|
typealias ChallengeFunction = suspend (String) -> Unit
|
||||||
|
|
||||||
|
enum class Cause {
|
||||||
|
FIRST,
|
||||||
|
SECOND,
|
||||||
|
ERROR,
|
||||||
|
LAST
|
||||||
|
}
|
||||||
|
|
||||||
|
class Some {
|
||||||
|
internal val register = mutableListOf<Pair<Cause, ChallengeFunction>>()
|
||||||
|
|
||||||
|
internal val challenges: List<ChallengeFunction>
|
||||||
|
get() = register.filter { it.first != ERROR }.sortedBy {
|
||||||
|
when (it.first) {
|
||||||
|
FIRST -> 1
|
||||||
|
SECOND -> 2
|
||||||
|
else -> throw AssertionError()
|
||||||
|
}
|
||||||
|
}.map { it.second }
|
||||||
|
}
|
||||||
Generated
+6
@@ -19326,6 +19326,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/integerLiterals/literalsInInference.kt");
|
runTest("compiler/testData/diagnostics/tests/integerLiterals/literalsInInference.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sortedBy.kt")
|
||||||
|
public void testSortedBy() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/integerLiterals/sortedBy.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("typealiasOnLong.kt")
|
@TestMetadata("typealiasOnLong.kt")
|
||||||
public void testTypealiasOnLong() throws Exception {
|
public void testTypealiasOnLong() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user