[FIR-TEST] Add new testdata generated after changes in previous commit
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
class A<T : A<T>>
|
||||
fun <T : A<*>> foo() {}
|
||||
class B<T : A<*>>
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// FILE: p/Base.java
|
||||
|
||||
package p;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Base<T> {
|
||||
void coll(Collection<?> r) {}
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
package p
|
||||
|
||||
class Derived: p.Base<String>()
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// FILE: p/Base.java
|
||||
|
||||
package p;
|
||||
|
||||
public class Base<T> {
|
||||
void foo(R<?> r) {}
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
package p
|
||||
|
||||
class R<T: R<T>>
|
||||
|
||||
class Derived: p.Base<String>()
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class R<T: R<T>>
|
||||
|
||||
open class Base<T> {
|
||||
fun foo(r: R<*>) {}
|
||||
}
|
||||
|
||||
class Derived: Base<String>()
|
||||
@@ -0,0 +1,28 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
// !CHECK_TYPE
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// FILE: main.kt
|
||||
class Inv<T>(val x: T)
|
||||
|
||||
class A<T : Inv<in T>> {
|
||||
fun foo(): T = null!!
|
||||
}
|
||||
|
||||
class Inv2<T : Inv2<in T>>(val x: T)
|
||||
|
||||
fun main(a: A<*>, j: JavaClass<*>, i2: Inv2<*>) {
|
||||
// Probably it's too restrictive to suppose star projection type here as Any?,
|
||||
// but looks like we can refine it later
|
||||
a.foo() checkType { <!UNRESOLVED_REFERENCE!>_<!><Any?>() }
|
||||
j.foo() checkType { <!UNRESOLVED_REFERENCE!>_<!><Any?>() }
|
||||
i2.x checkType { <!UNRESOLVED_REFERENCE!>_<!><Any?>() }
|
||||
|
||||
j.<!INAPPLICABLE_CANDIDATE!>bar<!>(1, 2, Any())
|
||||
j.bar(null)
|
||||
}
|
||||
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass<T extends JavaClass<? super T>> {
|
||||
public void bar(T... x) {}
|
||||
public T foo() {}
|
||||
}
|
||||
Reference in New Issue
Block a user