Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed
This commit is contained in:
-20
@@ -1,20 +0,0 @@
|
||||
// FILE: BehaviorSubject.java
|
||||
public class BehaviorSubject<T> extends Observable<T> {
|
||||
}
|
||||
|
||||
// FILE: Observable.java
|
||||
|
||||
public class Observable<T> {
|
||||
public static <T> Observable<T> create(Observable.OnSubscribe<T> f) {
|
||||
return null;
|
||||
}
|
||||
public interface OnSubscribe<T> {
|
||||
void call(T t);
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
fun main() {
|
||||
BehaviorSubject.create<String>(null)
|
||||
BehaviorSubject.create<Int> { }
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: BehaviorSubject.java
|
||||
public class BehaviorSubject<T> extends Observable<T> {
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
// FILE: Statics.java
|
||||
|
||||
public class Statics {
|
||||
public static void foo(Runnable r) {}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
class A : Statics() {
|
||||
fun test() {
|
||||
foo {}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: Statics.java
|
||||
|
||||
public class Statics {
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
// FILE: MyFuture.java
|
||||
|
||||
public interface MyFuture<V> {
|
||||
MyFuture<V> addListener(MyListener<? extends MyFuture<? super V>> listener);
|
||||
}
|
||||
|
||||
// FILE: MyListener.java
|
||||
|
||||
public interface MyListener<F extends MyFuture<?>> {
|
||||
void operationComplete(F future) throws Exception;
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
typealias Handler = (cause: Throwable?) -> Unit
|
||||
|
||||
fun <T> MyFuture<T>.setup() {
|
||||
addListener(ListenerImpl<T, MyFuture<T>>())
|
||||
addListener { }
|
||||
}
|
||||
|
||||
class ListenerImpl<T, F : MyFuture<T>> : MyListener<F>, Handler {
|
||||
override fun operationComplete(future: F) {
|
||||
}
|
||||
|
||||
override fun invoke(cause: Throwable?) {
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: MyFuture.java
|
||||
|
||||
public interface MyFuture<V> {
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
// FILE: FormFieldValidatorPresenterTest.java
|
||||
public class FormFieldValidatorPresenterTest<V extends String> {
|
||||
|
||||
public void setValidationListenerTest(ValidationListenerTest validationListener) {
|
||||
}
|
||||
|
||||
public interface ValidationListenerTest {
|
||||
void onValidityChanged(boolean valid);
|
||||
}
|
||||
}
|
||||
// FILE: main.kt
|
||||
fun <P : FormFieldValidatorPresenterTest<String>> setValidationListener(
|
||||
presenter: P,
|
||||
validationListener: (Boolean) -> Unit
|
||||
) {
|
||||
presenter.setValidationListenerTest(validationListener) // Error: Type mismatch: inferred type is (Boolean) -> Unit but FormFieldValidatorPresenterTest.ValidationListenerTest! was expected
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: FormFieldValidatorPresenterTest.java
|
||||
public class FormFieldValidatorPresenterTest<V extends String> {
|
||||
|
||||
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
// FILE: a/Statics.java
|
||||
|
||||
package a;
|
||||
|
||||
public class Statics {
|
||||
public static void foo(Runnable r) {}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
package b
|
||||
|
||||
import a.Statics.*
|
||||
|
||||
fun test() {
|
||||
foo {}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: a/Statics.java
|
||||
|
||||
package a;
|
||||
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
// FILE: a/Statics.java
|
||||
|
||||
package a;
|
||||
|
||||
public class Statics {
|
||||
public static void foo(Runnable r) {}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
package b;
|
||||
|
||||
import a.Statics.foo
|
||||
|
||||
fun test() {
|
||||
foo {}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: a/Statics.java
|
||||
|
||||
package a;
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_ANONYMOUS_PARAMETER
|
||||
// FILE: A.java
|
||||
public class A<K, V> {
|
||||
public void foo(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: BiFunction.java
|
||||
public interface BiFunction<T, U, R> {
|
||||
R apply(T t, U u);
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
fun main() {
|
||||
val a = A<Int, String>()
|
||||
a.foo(2, BiFunction { k, v -> null })
|
||||
a.foo(2) { k, v -> null } // See KT-12144
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_ANONYMOUS_PARAMETER
|
||||
// FILE: A.java
|
||||
public class A<K, V> {
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
// FILE: ALambda.java
|
||||
|
||||
public interface ALambda {
|
||||
ALambda curried();
|
||||
|
||||
ALambda tupled();
|
||||
}
|
||||
|
||||
// FILE: ACheckedFunction0.java
|
||||
|
||||
public interface ACheckedFunction0 extends ALambda {
|
||||
|
||||
Integer apply();
|
||||
|
||||
default ALambda curried() { return null; }
|
||||
default ALambda tupled() { return null; }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
fun test() {
|
||||
ACheckedFunction0 { 2 } // error: Interface ACheckedFunction0 does not have constructors
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: ALambda.java
|
||||
|
||||
public interface ALambda {
|
||||
|
||||
Reference in New Issue
Block a user