Add new FIR tests related to KT-31508 problems, replace failing MM testJava...Signature
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
// FULL_JDK
|
||||
class MyException : Exception()
|
||||
|
||||
fun test(e: MyException) {
|
||||
e.printStackTrace() // Cannot be resolved with early J2K mapping due deriving of kotlin.Throwable instead of java.lang.Throwable
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
FILE: MyException.kt
|
||||
public final class MyException : R|kotlin/Exception| {
|
||||
public constructor(): R|MyException| {
|
||||
super<R|kotlin/Exception|>()
|
||||
}
|
||||
|
||||
}
|
||||
public final fun test(e: R|MyException|): R|kotlin/Unit| {
|
||||
R|<local>/e|.R|kotlin/printStackTrace|()
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// FULL_JDK
|
||||
// FILE: MyIterable.java
|
||||
public interface MyIterable<T> extends Iterable<T>
|
||||
|
||||
// FILE: test.kt
|
||||
interface UseIterable : MyIterable<String> {
|
||||
fun test() {
|
||||
val it = iterator()
|
||||
val split = spliterator()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
FILE: test.kt
|
||||
public abstract interface UseIterable : R|MyIterable<kotlin/String>| {
|
||||
public open fun test(): R|kotlin/Unit| {
|
||||
lval it: R|kotlin/collections/MutableIterator<kotlin/String>| = this@R|kotlin/collections/MutableIterable|.R|FakeOverride<kotlin/collections/MutableIterable.iterator: R|kotlin/collections/MutableIterator<kotlin/String>|>|()
|
||||
lval split: <ERROR TYPE REF: Unresolved name: spliterator> = <Unresolved name: spliterator>#()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// FULL_JDK
|
||||
// FILE: MyMap.java
|
||||
|
||||
public abstract class MyMap implements java.util.Map<String, String> {}
|
||||
|
||||
// FILE: test.kt
|
||||
fun test(map: MyMap) {
|
||||
val result = map.getOrPut("key") { "value" } // Cannot be resolved without early J2K mapping
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
FILE: test.kt
|
||||
public final fun test(map: R|MyMap|): R|kotlin/Unit| {
|
||||
lval result: R|kotlin/String| = R|<local>/map|.R|kotlin/collections/getOrPut|<R|kotlin/String|, R|kotlin/String|>(String(key), <L> = getOrPut@fun <anonymous>(): R|kotlin/String| <kind=EXACTLY_ONCE> {
|
||||
String(value)
|
||||
}
|
||||
)
|
||||
}
|
||||
+15
@@ -86,6 +86,21 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
|
||||
runTest("compiler/fir/resolve/testData/diagnostics/j+k/KotlinClassParameterGeneric.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("MyException.kt")
|
||||
public void testMyException() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/diagnostics/j+k/MyException.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("MyIterable.kt")
|
||||
public void testMyIterable() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/diagnostics/j+k/MyIterable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("MyMap.kt")
|
||||
public void testMyMap() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/diagnostics/j+k/MyMap.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("outerInnerClasses.kt")
|
||||
public void testOuterInnerClasses() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/diagnostics/j+k/outerInnerClasses.kt");
|
||||
|
||||
Reference in New Issue
Block a user