Remove backend tests on old inference

Also remove any mentions of NewInference, and rename some tests.
This commit is contained in:
Alexander Udalov
2021-09-28 23:36:48 +02:00
parent 3626b1df44
commit 1071919706
179 changed files with 609 additions and 1953 deletions
@@ -1,7 +1,6 @@
// !LANGUAGE: -NewInference
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: example/Hello.java
package example;
@FunctionalInterface
@@ -17,27 +16,28 @@ public class SomeJavaClass<A> {
((Hello)hello).invoke("OK");
}
public void plus(Hello<A> hello) {
public SomeJavaClass<A> plus(Hello<A> hello) {
((Hello)hello).invoke("OK");
return this;
}
public void get(Hello<A> hello) {
((Hello)hello).invoke("OK");
}
public void set(int i, Hello<A> hello) {
((Hello)hello).invoke("OK");
}
}
// FILE: main.kt
import example.SomeJavaClass
fun box(): String {
val a: SomeJavaClass<out String> = SomeJavaClass()
var a: SomeJavaClass<out String> = SomeJavaClass()
var result = "fail"
// a::someFunction parameter has type of Nothing
// while it's completely safe to pass a lambda for a SAM
// since Hello is effectively contravariant by its parameter
// NB: this ^ is not supported by FIR yet
a.someFunction {
result = it
}
@@ -58,5 +58,19 @@ fun box(): String {
if (result != "OK") return "fail 3: $result"
result = "fail"
a += {
result = it
}
if (result != "OK") return "fail 4: $result"
result = "fail"
a[0] = { result = it }
if (result != "OK") return "fail 5: $result"
return "OK"
}