compiler testdata: s/trait/interface
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
// !DIAGNOSTICS: -BASE_WITH_NULLABLE_UPPER_BOUND
|
||||
// !CHECK_TYPE
|
||||
trait A<T>
|
||||
interface A<T>
|
||||
|
||||
fun <T> foo(a: A<T>, aN: A<T?>): T = throw Exception("$a $aN")
|
||||
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@
|
||||
|
||||
package kt7351
|
||||
|
||||
trait Node
|
||||
interface Node
|
||||
|
||||
trait Source<T> {
|
||||
interface Source<T> {
|
||||
fun f() : T
|
||||
}
|
||||
fun <T, S : Source<T>> S.woo() : T = this.f()
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
// !CHECK_TYPE
|
||||
trait A<T>
|
||||
interface A<T>
|
||||
|
||||
trait In<in T>
|
||||
interface In<in T>
|
||||
|
||||
trait Out<out T>
|
||||
interface Out<out T>
|
||||
|
||||
fun <T: Any> doT(t: T?): T = throw Exception("$t")
|
||||
fun <T: Any> doOut(o: Out<T?>): T { throw Exception("$o") }
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// !DIAGNOSTICS: -BASE_WITH_NULLABLE_UPPER_BOUND
|
||||
// !CHECK_TYPE
|
||||
trait A<T>
|
||||
interface A<T>
|
||||
|
||||
trait Out<out T>
|
||||
interface Out<out T>
|
||||
|
||||
fun <T> foo(a: A<T>, o: Out<T?>): T = throw Exception("$a $o")
|
||||
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// !DIAGNOSTICS: -BASE_WITH_NULLABLE_UPPER_BOUND
|
||||
// !CHECK_TYPE
|
||||
trait A<T>
|
||||
interface A<T>
|
||||
|
||||
trait In<in T>
|
||||
interface In<in T>
|
||||
|
||||
fun <T> foo(a: A<T>, i: In<T>): T = throw Exception("$a $i")
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package h
|
||||
|
||||
trait A<T> {}
|
||||
interface A<T> {}
|
||||
|
||||
fun <T> newA(): A<T> = throw Exception()
|
||||
|
||||
trait Z
|
||||
interface Z
|
||||
|
||||
fun <T> id(t: T): T = t
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package j
|
||||
|
||||
trait MyFunc<T> {}
|
||||
interface MyFunc<T> {}
|
||||
|
||||
class A(val b: B) {
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package a
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
val b: B
|
||||
val nb: B?
|
||||
}
|
||||
|
||||
trait B {
|
||||
interface B {
|
||||
fun foo(): Int
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package a
|
||||
|
||||
trait Persistent
|
||||
trait PersistentFactory<T>
|
||||
interface Persistent
|
||||
interface PersistentFactory<T>
|
||||
|
||||
class Relation<Source: Persistent, Target: Persistent>(
|
||||
val sources: PersistentFactory<Source>,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
package a
|
||||
|
||||
|
||||
trait Foo<A>
|
||||
interface Foo<A>
|
||||
|
||||
fun <A, B> Foo<A>.map(<!UNUSED_PARAMETER!>f<!>: (A) -> B): Foo<B> = object : Foo<B> {}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//KT-2320 failure of complex case of type inference
|
||||
package i
|
||||
|
||||
trait NotMap<B>
|
||||
interface NotMap<B>
|
||||
|
||||
trait Entry<B> {
|
||||
interface Entry<B> {
|
||||
fun getValue(): B
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
package a
|
||||
|
||||
trait MyType {}
|
||||
interface MyType {}
|
||||
class MyClass<T> : MyType {}
|
||||
|
||||
public open class HttpResponse() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package a
|
||||
|
||||
trait Closeable {}
|
||||
interface Closeable {}
|
||||
class C : Closeable {}
|
||||
|
||||
public inline fun <T: Closeable, R> T.use1(block: (T)-> R) : R {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package a
|
||||
|
||||
trait Closeable {
|
||||
interface Closeable {
|
||||
fun close() {}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package a
|
||||
|
||||
trait Closeable {
|
||||
interface Closeable {
|
||||
fun close() {}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package a
|
||||
|
||||
trait Closeable {
|
||||
interface Closeable {
|
||||
fun close() {}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package c
|
||||
|
||||
trait A<T>
|
||||
interface A<T>
|
||||
|
||||
fun test(a: A<Int>?) {
|
||||
a<!UNSAFE_CALL!>.<!>foo() //no error
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
package arrays
|
||||
|
||||
trait A
|
||||
trait B
|
||||
interface A
|
||||
interface B
|
||||
|
||||
object CAB : A, B
|
||||
object DAB : A, B
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package a
|
||||
|
||||
trait Closeable {}
|
||||
interface Closeable {}
|
||||
class C : Closeable {}
|
||||
|
||||
fun <T: Closeable, R> T.foo(block: (T)-> R) = block
|
||||
|
||||
@@ -11,14 +11,14 @@ fun newList<S>() : ArrayList<S> {
|
||||
return ArrayList<S>()
|
||||
}
|
||||
|
||||
trait Out<out T>
|
||||
trait In<in T>
|
||||
interface Out<out T>
|
||||
interface In<in T>
|
||||
|
||||
trait Two<T, R>
|
||||
interface Two<T, R>
|
||||
|
||||
trait A
|
||||
trait B: A
|
||||
trait C: A
|
||||
interface A
|
||||
interface B: A
|
||||
interface C: A
|
||||
|
||||
fun <T, R> foo(o: Out<T>, i: In<R>): Two<T, R> = throw Exception("$o $i")
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package a
|
||||
|
||||
trait A
|
||||
interface A
|
||||
|
||||
fun <T> emptyList(): List<T> = throw Exception()
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
package s
|
||||
|
||||
trait In<in T>
|
||||
interface In<in T>
|
||||
|
||||
trait A
|
||||
trait B
|
||||
trait C: A, B
|
||||
interface A
|
||||
interface B
|
||||
interface C: A, B
|
||||
|
||||
fun <T> foo(in1: In<T>, in2: In<T>): T = throw Exception("$in1 $in2")
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ fun <T: Any> foo(v: Any): T? = unescape(v)
|
||||
|
||||
//--------------
|
||||
|
||||
trait A
|
||||
interface A
|
||||
|
||||
fun <R : A> unescapeA(value: Any): R? = throw Exception("$value")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user