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:
Denis Zharkov
2016-04-27 13:53:52 +03:00
parent 8e5481b5d5
commit 55c4f875c8
7 changed files with 161 additions and 64 deletions
@@ -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)
}
@@ -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
@@ -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");