K2: add a reproducer for getOrDefault false negative in metadata compilation
This case is similar to KT-57268 in early JDKs
This commit is contained in:
committed by
Space Team
parent
38aec7333b
commit
7599ff0ef1
@@ -0,0 +1,3 @@
|
|||||||
|
$TESTDATA_DIR$/getOrDefault.kt
|
||||||
|
-d
|
||||||
|
$TEMP_DIR$
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
// This should not compile: only JVM 1.8+ contains getOrDefault
|
||||||
|
fun foo(map: Map<String, Int>) = map.getOrDefault("", 0)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
OK
|
||||||
@@ -1549,6 +1549,11 @@ public class CliTestGenerated extends AbstractCliTest {
|
|||||||
runTest("compiler/testData/cli/metadata/anonymousObjectType.args");
|
runTest("compiler/testData/cli/metadata/anonymousObjectType.args");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("getOrDefault.args")
|
||||||
|
public void testGetOrDefault() throws Exception {
|
||||||
|
runTest("compiler/testData/cli/metadata/getOrDefault.args");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("hmppModules.args")
|
@TestMetadata("hmppModules.args")
|
||||||
public void testHmppModules() throws Exception {
|
public void testHmppModules() throws Exception {
|
||||||
runTest("compiler/testData/cli/metadata/hmppModules.args");
|
runTest("compiler/testData/cli/metadata/hmppModules.args");
|
||||||
|
|||||||
Reference in New Issue
Block a user