TypeSubstitutor respects flexible types
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import java.util.*
|
||||
|
||||
fun takeJ(map: Map<Any, Any>) {}
|
||||
|
||||
fun test() {
|
||||
takeJ(HashMap())
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// FILE: p/J.java
|
||||
|
||||
package p;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class J {
|
||||
public ArrayList<String> list() { return null; }
|
||||
public void takeList(ArrayList<String> list) { }
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
import p.*
|
||||
|
||||
fun test(j: J) {
|
||||
j.takeList(j.list())
|
||||
val l = j.list()
|
||||
j.takeList(l)
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// FILE: p/J.java
|
||||
|
||||
package p;
|
||||
|
||||
public class J {
|
||||
public J j() { return this; }
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
import p.*
|
||||
|
||||
fun takeJ(j: J) {}
|
||||
|
||||
fun test() {
|
||||
takeJ(J().j())
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import java.util.*
|
||||
|
||||
fun test(map: Map<Any, Any>) {
|
||||
HashMap(map)
|
||||
}
|
||||
@@ -7715,6 +7715,26 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("javaCollectionToKotlin.kt")
|
||||
public void testJavaCollectionToKotlin() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/platformTypes/methodCall/javaCollectionToKotlin.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("javaToJava.kt")
|
||||
public void testJavaToJava() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToJava.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("javaToKotlin.kt")
|
||||
public void testJavaToKotlin() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToKotlin.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kotlinCollectionToJava.kt")
|
||||
public void testKotlinCollectionToJava() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/platformTypes/methodCall/kotlinCollectionToJava.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("list.kt")
|
||||
public void testList() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/platformTypes/methodCall/list.kt");
|
||||
|
||||
Reference in New Issue
Block a user