Use signatures instead of fq-names in special built-ins
It's necessary to distinguish overloads, e.g. MutableMap.remove now has two versions
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
import java.util.concurrent.*
|
||||
|
||||
val concurrent: ConcurrentMap<String, Int> = null!!
|
||||
val concurrentHash: ConcurrentHashMap<String, Int> = null!!
|
||||
|
||||
fun foo() {
|
||||
// TODO: Too permissive
|
||||
concurrent.remove("", 1)
|
||||
concurrent.remove("", "")
|
||||
concurrentHash.remove("", 1)
|
||||
concurrentHash.remove("", "")
|
||||
|
||||
// Flexible types
|
||||
concurrent.remove(null, 1)
|
||||
concurrent.remove(null, null)
|
||||
|
||||
// @PurelyImplements
|
||||
concurrentHash.remove(null, 1)
|
||||
concurrentHash.remove(null, null)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
public val concurrent: java.util.concurrent.ConcurrentMap<kotlin.String, kotlin.Int>
|
||||
public val concurrentHash: java.util.concurrent.ConcurrentHashMap<kotlin.String, kotlin.Int>
|
||||
public fun foo(): kotlin.Unit
|
||||
+6
@@ -121,6 +121,12 @@ public class DiagnosticsWithJava8TestGenerated extends AbstractDiagnosticsWithFu
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithJava8/targetedBuiltIns"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("concurrentMapRemove.kt")
|
||||
public void testConcurrentMapRemove() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJava8/targetedBuiltIns/concurrentMapRemove.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("forEachRemainingNullability.kt")
|
||||
public void testForEachRemainingNullability() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJava8/targetedBuiltIns/forEachRemainingNullability.kt");
|
||||
|
||||
Reference in New Issue
Block a user