compiler testdata: s/trait/interface
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
trait Pa<X, Y>
|
||||
interface Pa<X, Y>
|
||||
|
||||
fun foo(<!UNUSED_PARAMETER(IGNORE)!>u<!> : Unit) : Int = 1
|
||||
fun bas(<!UNUSED_PARAMETER!>u<!> : Pa<Int, String>) = 3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package abstract
|
||||
|
||||
trait MyTrait {
|
||||
interface MyTrait {
|
||||
//properties
|
||||
val a: Int
|
||||
val a1: Int = <!PROPERTY_INITIALIZER_IN_TRAIT!>1<!>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait NoC {
|
||||
interface NoC {
|
||||
<!ANONYMOUS_INITIALIZER_IN_TRAIT!>init {
|
||||
|
||||
}<!>
|
||||
|
||||
@@ -49,7 +49,7 @@ fun main(args : Array<String>) {
|
||||
println(result)
|
||||
}
|
||||
|
||||
trait Element {
|
||||
interface Element {
|
||||
fun render(builder : StringBuilder, indent : String)
|
||||
|
||||
override fun toString() : String {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait A {
|
||||
interface A {
|
||||
fun foo() : Int = 1
|
||||
fun foo2() : Int = 1
|
||||
fun foo1() : Int = 1
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
trait T {
|
||||
interface T {
|
||||
val a = <!PROPERTY_INITIALIZER_IN_TRAIT!><!UNRESOLVED_REFERENCE!>Foo<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>bar<!>()<!>
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
trait Base {
|
||||
interface Base {
|
||||
fun f() = 1
|
||||
}
|
||||
|
||||
open class Left() : Base
|
||||
|
||||
trait Right : Base
|
||||
interface Right : Base
|
||||
|
||||
class Diamond() : Left(), Right
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
trait Base<P> {
|
||||
interface Base<P> {
|
||||
fun f() = 1
|
||||
}
|
||||
|
||||
open class Left<P>() : Base<P>
|
||||
|
||||
trait Right<P> : Base<P>
|
||||
interface Right<P> : Base<P>
|
||||
|
||||
class Diamond<P>() : Left<P>(), Right<P>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait Base {
|
||||
interface Base {
|
||||
var v : Int
|
||||
get() = 1
|
||||
set(v) {}
|
||||
@@ -6,6 +6,6 @@ trait Base {
|
||||
|
||||
open class Left() : Base
|
||||
|
||||
trait Right : Base
|
||||
interface Right : Base
|
||||
|
||||
class Diamond() : Left(), Right
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
// FILE: b.kt
|
||||
trait A<in T> {}
|
||||
trait B<T> : A<Int> {}
|
||||
trait C<T> : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>B<T>, A<T><!> {}
|
||||
trait C1<T> : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>B<T>, A<Any><!> {}
|
||||
trait D : <!INCONSISTENT_TYPE_PARAMETER_VALUES, INCONSISTENT_TYPE_PARAMETER_VALUES!>C<Boolean>, B<Double><!>{}
|
||||
interface A<in T> {}
|
||||
interface B<T> : A<Int> {}
|
||||
interface C<T> : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>B<T>, A<T><!> {}
|
||||
interface C1<T> : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>B<T>, A<Any><!> {}
|
||||
interface D : <!INCONSISTENT_TYPE_PARAMETER_VALUES, INCONSISTENT_TYPE_PARAMETER_VALUES!>C<Boolean>, B<Double><!>{}
|
||||
|
||||
trait A1<out T> {}
|
||||
trait B1 : A1<Int> {}
|
||||
trait B2 : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>A1<Any>, B1<!> {}
|
||||
interface A1<out T> {}
|
||||
interface B1 : A1<Int> {}
|
||||
interface B2 : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>A1<Any>, B1<!> {}
|
||||
|
||||
trait BA1<T> {}
|
||||
trait BB1 : BA1<Int> {}
|
||||
trait BB2 : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>BA1<Any>, BB1<!> {}
|
||||
interface BA1<T> {}
|
||||
interface BB1 : BA1<Int> {}
|
||||
interface BB2 : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>BA1<Any>, BB1<!> {}
|
||||
|
||||
|
||||
// FILE: b.kt
|
||||
package x
|
||||
trait AA1<out T> {}
|
||||
trait AB1 : AA1<Int> {}
|
||||
trait AB3 : AA1<Comparable<Int>> {}
|
||||
trait AB2 : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>AA1<Number>, AB1, AB3<!> {}
|
||||
interface AA1<out T> {}
|
||||
interface AB1 : AA1<Int> {}
|
||||
interface AB3 : AA1<Comparable<Int>> {}
|
||||
interface AB2 : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>AA1<Number>, AB1, AB3<!> {}
|
||||
|
||||
// FILE: b.kt
|
||||
package x2
|
||||
trait AA1<out T> {}
|
||||
trait AB1 : AA1<Any> {}
|
||||
trait AB3 : AA1<Comparable<Int>> {}
|
||||
trait AB2 : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>AA1<Number>, AB1, AB3<!> {}
|
||||
interface AA1<out T> {}
|
||||
interface AB1 : AA1<Any> {}
|
||||
interface AB3 : AA1<Comparable<Int>> {}
|
||||
interface AB2 : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>AA1<Number>, AB1, AB3<!> {}
|
||||
|
||||
// FILE: b.kt
|
||||
package x3
|
||||
trait AA1<in T> {}
|
||||
trait AB1 : AA1<Any> {}
|
||||
trait AB3 : AA1<Comparable<Int>> {}
|
||||
trait AB2 : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>AA1<Number>, AB1, AB3<!> {}
|
||||
interface AA1<in T> {}
|
||||
interface AB1 : AA1<Any> {}
|
||||
interface AB3 : AA1<Comparable<Int>> {}
|
||||
interface AB2 : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>AA1<Number>, AB1, AB3<!> {}
|
||||
|
||||
// FILE: b.kt
|
||||
package sx2
|
||||
trait AA1<in T> {}
|
||||
trait AB1 : AA1<Int> {}
|
||||
trait AB3 : AA1<Comparable<Int>> {}
|
||||
trait AB2 : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>AA1<Number>, AB1, AB3<!> {}
|
||||
interface AA1<in T> {}
|
||||
interface AB1 : AA1<Int> {}
|
||||
interface AB3 : AA1<Comparable<Int>> {}
|
||||
interface AB2 : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>AA1<Number>, AB1, AB3<!> {}
|
||||
@@ -4,11 +4,11 @@ open class A() {
|
||||
fun foo() : Int = 1
|
||||
}
|
||||
|
||||
trait B {
|
||||
interface B {
|
||||
fun bar() : Double = 1.0;
|
||||
}
|
||||
|
||||
trait G<X> {
|
||||
interface G<X> {
|
||||
val <X : A> boo: Double where X : B
|
||||
val <A> bal: Double where A : B
|
||||
val <Y : B> bas: Double where <!NAME_IN_CONSTRAINT_IS_NOT_A_TYPE_PARAMETER!>X<!> : B
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
trait Aaa<T> {
|
||||
interface Aaa<T> {
|
||||
fun zzz(value: T): Unit
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ open class Var() {
|
||||
open var v : Int = 1
|
||||
}
|
||||
|
||||
trait VarT {
|
||||
interface VarT {
|
||||
var v : Int
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
trait A<T> {}
|
||||
trait B<T> {}
|
||||
trait C<T> {}
|
||||
trait D<T> {}
|
||||
interface A<T> {}
|
||||
interface B<T> {}
|
||||
interface C<T> {}
|
||||
interface D<T> {}
|
||||
|
||||
trait Test : A<<!PROJECTION_IN_IMMEDIATE_ARGUMENT_TO_SUPERTYPE!>in<!> Int>, B<<!PROJECTION_IN_IMMEDIATE_ARGUMENT_TO_SUPERTYPE!>out<!> Int>, C<<!PROJECTION_IN_IMMEDIATE_ARGUMENT_TO_SUPERTYPE!>*<!>><!NULLABLE_SUPERTYPE!>?<!><!REDUNDANT_NULLABLE!>?<!><!REDUNDANT_NULLABLE!>?<!>, D<Int> {}
|
||||
interface Test : A<<!PROJECTION_IN_IMMEDIATE_ARGUMENT_TO_SUPERTYPE!>in<!> Int>, B<<!PROJECTION_IN_IMMEDIATE_ARGUMENT_TO_SUPERTYPE!>out<!> Int>, C<<!PROJECTION_IN_IMMEDIATE_ARGUMENT_TO_SUPERTYPE!>*<!>><!NULLABLE_SUPERTYPE!>?<!><!REDUNDANT_NULLABLE!>?<!><!REDUNDANT_NULLABLE!>?<!>, D<Int> {}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
fun foo(f: <!UNSUPPORTED!>This<!>) {}
|
||||
|
||||
trait C<T: C<<!UNSUPPORTED!>This<!>>> {
|
||||
interface C<T: C<<!UNSUPPORTED!>This<!>>> {
|
||||
val x: <!UNSUPPORTED!>This<!>
|
||||
val y: <!UNSUPPORTED!>This<!>?
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
In a supertype list:
|
||||
Same type should not be mentioned twice
|
||||
Same type should not be indirectly mentioned with incoherent type arguments
|
||||
Every trait's required dependencies should be satisfied
|
||||
Every interface's required dependencies should be satisfied
|
||||
No final types should appear
|
||||
Only one class is allowed
|
||||
*/
|
||||
@@ -17,24 +17,24 @@ open class C2 {}
|
||||
|
||||
open class C3 {}
|
||||
|
||||
trait T1 {}
|
||||
interface T1 {}
|
||||
|
||||
trait T2<T> {}
|
||||
interface T2<T> {}
|
||||
|
||||
trait Test<!CONSTRUCTOR_IN_TRAIT!>()<!> {
|
||||
interface Test<!CONSTRUCTOR_IN_TRAIT!>()<!> {
|
||||
}
|
||||
|
||||
trait Test1 : <!TRAIT_WITH_SUPERCLASS!>C2<!><!SUPERTYPE_INITIALIZED_IN_TRAIT!>()<!> {}
|
||||
interface Test1 : <!TRAIT_WITH_SUPERCLASS!>C2<!><!SUPERTYPE_INITIALIZED_IN_TRAIT!>()<!> {}
|
||||
|
||||
trait Test2 : <!TRAIT_WITH_SUPERCLASS!>C2<!> {}
|
||||
interface Test2 : <!TRAIT_WITH_SUPERCLASS!>C2<!> {}
|
||||
|
||||
trait Test3 : <!TRAIT_WITH_SUPERCLASS!>C2<!>, <!MANY_CLASSES_IN_SUPERTYPE_LIST!>C3<!> {}
|
||||
interface Test3 : <!TRAIT_WITH_SUPERCLASS!>C2<!>, <!MANY_CLASSES_IN_SUPERTYPE_LIST!>C3<!> {}
|
||||
|
||||
trait Test4 : T1 {}
|
||||
interface Test4 : T1 {}
|
||||
|
||||
trait Test5 : T1, <!SUPERTYPE_APPEARS_TWICE!>T1<!> {}
|
||||
interface Test5 : T1, <!SUPERTYPE_APPEARS_TWICE!>T1<!> {}
|
||||
|
||||
trait Test6 : <!TRAIT_WITH_SUPERCLASS, FINAL_SUPERTYPE!>C1<!> {}
|
||||
interface Test6 : <!TRAIT_WITH_SUPERCLASS, FINAL_SUPERTYPE!>C1<!> {}
|
||||
|
||||
class CTest1() : OC1() {}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait MyTrait: <!PLATFORM_CLASS_MAPPED_TO_KOTLIN, TRAIT_WITH_SUPERCLASS!>Object<!> {
|
||||
interface MyTrait: <!PLATFORM_CLASS_MAPPED_TO_KOTLIN, TRAIT_WITH_SUPERCLASS!>Object<!> {
|
||||
override fun toString(): String
|
||||
public override fun finalize()
|
||||
public <!OVERRIDING_FINAL_MEMBER!>override<!> fun wait()
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
class C(val a: String) {}
|
||||
|
||||
trait T1<!CONSTRUCTOR_IN_TRAIT!>(val x: String)<!> {}
|
||||
interface T1<!CONSTRUCTOR_IN_TRAIT!>(val x: String)<!> {}
|
||||
|
||||
trait T2<!CONSTRUCTOR_IN_TRAIT!>()<!> {}
|
||||
interface T2<!CONSTRUCTOR_IN_TRAIT!>()<!> {}
|
||||
|
||||
trait T3<!CONSTRUCTOR_IN_TRAIT!>(<!UNUSED_PARAMETER!>a<!>: Int)<!> {}
|
||||
interface T3<!CONSTRUCTOR_IN_TRAIT!>(<!UNUSED_PARAMETER!>a<!>: Int)<!> {}
|
||||
|
||||
trait T4 {
|
||||
interface T4 {
|
||||
<!CONSTRUCTOR_IN_TRAIT!>constructor(a: <!DEBUG_INFO_MISSING_UNRESOLVED!>Int<!>) {
|
||||
val b: <!DEBUG_INFO_MISSING_UNRESOLVED!>Int<!> = 1
|
||||
}<!>
|
||||
|
||||
@@ -112,7 +112,7 @@ fun testFunctionLiterals() {
|
||||
}
|
||||
}
|
||||
|
||||
trait Trait {
|
||||
interface Trait {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
val a = object: T {}
|
||||
open class C
|
||||
trait T
|
||||
interface T
|
||||
|
||||
annotation class Ann: <!SUPERTYPES_FOR_ANNOTATION_CLASS!>C()<!>
|
||||
annotation class Ann2: <!SUPERTYPES_FOR_ANNOTATION_CLASS!>T<!>
|
||||
|
||||
@@ -6,7 +6,7 @@ class A {
|
||||
|
||||
<!ILLEGAL_ANNOTATION_KEYWORD!>annotation<!> object O {}
|
||||
|
||||
<!ILLEGAL_ANNOTATION_KEYWORD!>annotation<!> trait T {}
|
||||
<!ILLEGAL_ANNOTATION_KEYWORD!>annotation<!> interface T {}
|
||||
|
||||
<!ILLEGAL_ANNOTATION_KEYWORD!>annotation<!> fun f() = 0
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ fun bar2(): Array<Q> = null!!
|
||||
|
||||
val y: Array<[<!DEBUG_INFO_MISSING_UNRESOLVED!>Ann<!>] String?> = arrayOfNulls(1)
|
||||
val block: ([<!DEBUG_INFO_MISSING_UNRESOLVED!>Ann<!>] x: <!DEPRECATED_ANNOTATION_SYNTAX!>[Ann]<!> String) -> <!DEPRECATED_ANNOTATION_SYNTAX!>[Ann]<!> String = { "" }
|
||||
trait B
|
||||
trait D : [<!DEBUG_INFO_MISSING_UNRESOLVED!>Ann<!>] B
|
||||
interface B
|
||||
interface D : [<!DEBUG_INFO_MISSING_UNRESOLVED!>Ann<!>] B
|
||||
|
||||
Ann(<!ANNOTATION_PARAMETER_MUST_BE_CONST!><!DEPRECATED_ANNOTATION_SYNTAX!>[Ann]<!> 1<!>) class MyClass
|
||||
|
||||
@@ -5,7 +5,7 @@ class A {
|
||||
<!UNRESOLVED_REFERENCE!>@aaa<!> init {}
|
||||
}
|
||||
|
||||
trait T {
|
||||
interface T {
|
||||
<!ANONYMOUS_INITIALIZER_IN_TRAIT!>ann init {}<!>
|
||||
<!ANONYMOUS_INITIALIZER_IN_TRAIT!>@ann init {}<!>
|
||||
<!ANONYMOUS_INITIALIZER_IN_TRAIT!><!UNRESOLVED_REFERENCE!>aaa<!> init {}<!>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
trait Map<K, out V>
|
||||
trait MutableMap<K, V>: Map<K, V> {
|
||||
interface Map<K, out V>
|
||||
interface MutableMap<K, V>: Map<K, V> {
|
||||
fun set(k: K, v: V)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
trait A
|
||||
trait B: A
|
||||
trait D
|
||||
interface A
|
||||
interface B: A
|
||||
interface D
|
||||
|
||||
trait BaseSuper<out T>
|
||||
trait BaseImpl: BaseSuper<D>
|
||||
trait DerivedSuper<out S>: <!INCONSISTENT_TYPE_PARAMETER_VALUES!>BaseSuper<S>, BaseImpl<!>
|
||||
interface BaseSuper<out T>
|
||||
interface BaseImpl: BaseSuper<D>
|
||||
interface DerivedSuper<out S>: <!INCONSISTENT_TYPE_PARAMETER_VALUES!>BaseSuper<S>, BaseImpl<!>
|
||||
|
||||
fun test(t: BaseSuper<B>) = t is DerivedSuper<A>
|
||||
@@ -1,6 +1,6 @@
|
||||
trait A
|
||||
trait B: A
|
||||
interface A
|
||||
interface B: A
|
||||
|
||||
trait Base<T>
|
||||
interface Base<T>
|
||||
|
||||
fun <T> test(a: Base<B>) where T: Base<A> = a is <!CANNOT_CHECK_FOR_ERASED!>T<!>
|
||||
@@ -1,3 +1,3 @@
|
||||
trait A
|
||||
trait B
|
||||
interface A
|
||||
interface B
|
||||
fun testing(a: A) = a as B
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait Aaa
|
||||
trait Bbb
|
||||
interface Aaa
|
||||
interface Bbb
|
||||
|
||||
fun f(a: Aaa) = a is Bbb
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
trait Tr
|
||||
trait G<T>
|
||||
interface Tr
|
||||
interface G<T>
|
||||
|
||||
fun test(tr: Tr): Any {
|
||||
return tr as G<<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>G<!>>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait Tr<T>
|
||||
trait G<T> : Tr<T>
|
||||
interface Tr<T>
|
||||
interface G<T> : Tr<T>
|
||||
|
||||
fun test(tr: Tr<String>) {
|
||||
val v = tr as G?
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait Tr
|
||||
trait G<T>
|
||||
interface Tr
|
||||
interface G<T>
|
||||
|
||||
fun test(tr: Tr) {
|
||||
val v = tr as <!NO_TYPE_ARGUMENTS_ON_RHS!>G?<!>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait Either<out A, out B>
|
||||
trait Left<out A>: Either<A, Nothing>
|
||||
trait Right<out B>: Either<Nothing, B>
|
||||
interface Either<out A, out B>
|
||||
interface Left<out A>: Either<A, Nothing>
|
||||
interface Right<out B>: Either<Nothing, B>
|
||||
|
||||
class C1(val v1: Int)
|
||||
class C2(val v2: Int)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// !DIAGNOSTICS: -DEBUG_INFO_SMARTCAST
|
||||
trait Either<out A, out B>
|
||||
trait Left<out A>: Either<A, Nothing> {
|
||||
interface Either<out A, out B>
|
||||
interface Left<out A>: Either<A, Nothing> {
|
||||
val value: A
|
||||
}
|
||||
trait Right<out B>: Either<Nothing, B> {
|
||||
interface Right<out B>: Either<Nothing, B> {
|
||||
val value: B
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// !DIAGNOSTICS: -DEBUG_INFO_SMARTCAST
|
||||
trait Either<out A, out B>
|
||||
trait Left<out A>: Either<A, Nothing> {
|
||||
interface Either<out A, out B>
|
||||
interface Left<out A>: Either<A, Nothing> {
|
||||
val value: A
|
||||
}
|
||||
trait Right<out B>: Either<Nothing, B> {
|
||||
interface Right<out B>: Either<Nothing, B> {
|
||||
val value: B
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait Either<out A, out B>
|
||||
trait Left<out A>: Either<A, Nothing>
|
||||
trait Right<out B>: Either<Nothing, B>
|
||||
interface Either<out A, out B>
|
||||
interface Left<out A>: Either<A, Nothing>
|
||||
interface Right<out B>: Either<Nothing, B>
|
||||
|
||||
class C1(val v1: Int)
|
||||
class C2(val v2: Int)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// !DIAGNOSTICS: -DEBUG_INFO_SMARTCAST
|
||||
trait Either<out A, out B>
|
||||
trait Left<out A>: Either<A, Nothing> {
|
||||
interface Either<out A, out B>
|
||||
interface Left<out A>: Either<A, Nothing> {
|
||||
val value: A
|
||||
}
|
||||
trait Right<out B>: Either<Nothing, B> {
|
||||
interface Right<out B>: Either<Nothing, B> {
|
||||
val value: B
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait B<T>
|
||||
trait G<T>: B<T>
|
||||
interface B<T>
|
||||
interface G<T>: B<T>
|
||||
|
||||
fun f(p: B<<!UNRESOLVED_REFERENCE!>Foo<!>>): Any {
|
||||
val v = <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>p<!> as G
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait Tr<T>
|
||||
trait G<T> : Tr<T>
|
||||
interface Tr<T>
|
||||
interface G<T> : Tr<T>
|
||||
|
||||
fun test(tr: Tr<String>?) {
|
||||
val v = tr as G
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait Tr
|
||||
trait G<T>
|
||||
interface Tr
|
||||
interface G<T>
|
||||
|
||||
fun test(tr: Tr?) {
|
||||
val v = tr as <!NO_TYPE_ARGUMENTS_ON_RHS!>G<!>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait Tr<T>
|
||||
trait G<T> : Tr<T>
|
||||
interface Tr<T>
|
||||
interface G<T> : Tr<T>
|
||||
|
||||
fun test(tr: Tr<String>?) {
|
||||
val v = tr as G?
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait Tr
|
||||
trait G<T>
|
||||
interface Tr
|
||||
interface G<T>
|
||||
|
||||
fun test(tr: Tr?) {
|
||||
val v = tr as <!NO_TYPE_ARGUMENTS_ON_RHS!>G?<!>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait B<T>
|
||||
interface B<T>
|
||||
class G<T>: B<T>
|
||||
|
||||
fun f(b: B<String>?) = b is G?<!REDUNDANT_NULLABLE!>?<!>
|
||||
@@ -1,7 +1,7 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait Tr
|
||||
trait G<T>
|
||||
interface Tr
|
||||
interface G<T>
|
||||
|
||||
fun test(tr: Tr) {
|
||||
val v = tr as <!NO_TYPE_ARGUMENTS_ON_RHS!>G<!>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait Tr
|
||||
trait G<T>
|
||||
interface Tr
|
||||
interface G<T>
|
||||
|
||||
fun test(tr: Tr) = checkSubtype<<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>G<!>>(tr)
|
||||
@@ -1,4 +1,4 @@
|
||||
trait Tr
|
||||
trait G<T>
|
||||
interface Tr
|
||||
interface G<T>
|
||||
|
||||
fun test(tr: Tr) = tr is <!NO_TYPE_ARGUMENTS_ON_RHS!>G<!>
|
||||
@@ -1,4 +1,4 @@
|
||||
class G<T>
|
||||
trait Tr
|
||||
interface Tr
|
||||
|
||||
fun f(q: Tr) = q is G<*>
|
||||
@@ -1,12 +1,12 @@
|
||||
// !DIAGNOSTICS: -WARNING +CAST_NEVER_SUCCEEDS
|
||||
trait T1
|
||||
trait T2
|
||||
trait T3
|
||||
interface T1
|
||||
interface T2
|
||||
interface T3
|
||||
open class OC1: T1
|
||||
open class OC2: OC1(), T2
|
||||
class FC1: OC2(), T3
|
||||
trait T4: OC1
|
||||
trait T5: T2
|
||||
interface T4: OC1
|
||||
interface T5: T2
|
||||
|
||||
fun test<TP1: OC1, TP2: T2, TP3: OC2>(
|
||||
t2: T2,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// !DIAGNOSTICS: -WARNING +CAST_NEVER_SUCCEEDS
|
||||
trait Trait1
|
||||
trait Trait2
|
||||
interface Trait1
|
||||
interface Trait2
|
||||
open class OClass1
|
||||
open class OClass2
|
||||
class FClass1
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait A
|
||||
trait B : A
|
||||
trait C : B
|
||||
interface A
|
||||
interface B : A
|
||||
interface C : B
|
||||
|
||||
fun test(b: B) {
|
||||
b checkType { _<B>() }
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
trait X {
|
||||
interface X {
|
||||
fun f(): Boolean
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
// KT-4034 An expression of type Nothing may not affect 'definite return' analysis
|
||||
|
||||
trait JavaClassifierType
|
||||
trait TypeUsage
|
||||
trait JetType
|
||||
interface JavaClassifierType
|
||||
interface TypeUsage
|
||||
interface JetType
|
||||
|
||||
private fun transformClassifierType(classifierType: JavaClassifierType, howThisTypeIsUsed: TypeUsage): JetType? {
|
||||
null!!
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//KT-1191 Wrong detection of unused parameters
|
||||
package kt1191
|
||||
|
||||
trait FunctionalList<T> {
|
||||
interface FunctionalList<T> {
|
||||
val size: Int
|
||||
val head: T
|
||||
val tail: FunctionalList<T>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//KT-2226 Parameter used as delegation by object marked as unused
|
||||
package a
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
fun foo() : Int
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ fun box() {
|
||||
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
}
|
||||
|
||||
trait X {
|
||||
interface X {
|
||||
fun f(): Boolean
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ fun <T: Any> fn(t1: T, t2: T?) {
|
||||
y.hashCode()
|
||||
}
|
||||
|
||||
trait Tr {
|
||||
interface Tr {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
trait A {
|
||||
interface A {
|
||||
fun foo() {}
|
||||
}
|
||||
trait B : A, <!CYCLIC_INHERITANCE_HIERARCHY!>E<!> {}
|
||||
trait C : <!CYCLIC_INHERITANCE_HIERARCHY!>B<!> {}
|
||||
trait D : <!CYCLIC_INHERITANCE_HIERARCHY!>B<!> {}
|
||||
trait E : <!CYCLIC_INHERITANCE_HIERARCHY!>F<!> {}
|
||||
trait F : <!CYCLIC_INHERITANCE_HIERARCHY!>D<!>, <!CYCLIC_INHERITANCE_HIERARCHY!>C<!> {}
|
||||
trait G : F {}
|
||||
trait H : F {}
|
||||
interface B : A, <!CYCLIC_INHERITANCE_HIERARCHY!>E<!> {}
|
||||
interface C : <!CYCLIC_INHERITANCE_HIERARCHY!>B<!> {}
|
||||
interface D : <!CYCLIC_INHERITANCE_HIERARCHY!>B<!> {}
|
||||
interface E : <!CYCLIC_INHERITANCE_HIERARCHY!>F<!> {}
|
||||
interface F : <!CYCLIC_INHERITANCE_HIERARCHY!>D<!>, <!CYCLIC_INHERITANCE_HIERARCHY!>C<!> {}
|
||||
interface G : F {}
|
||||
interface H : F {}
|
||||
|
||||
val a : A? = null
|
||||
val b : B? = null
|
||||
|
||||
@@ -6,7 +6,7 @@ interface A extends C {
|
||||
|
||||
// FILE: B.kt
|
||||
|
||||
trait B : <!CYCLIC_INHERITANCE_HIERARCHY!>A<!> {
|
||||
interface B : <!CYCLIC_INHERITANCE_HIERARCHY!>A<!> {
|
||||
fun bar()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// FILE: ExceptionTracker.kt
|
||||
|
||||
trait ExceptionTracker : <!CYCLIC_INHERITANCE_HIERARCHY!>LockBasedStorageManager.ExceptionHandlingStrategy<!> {
|
||||
interface ExceptionTracker : <!CYCLIC_INHERITANCE_HIERARCHY!>LockBasedStorageManager.ExceptionHandlingStrategy<!> {
|
||||
}
|
||||
|
||||
// FILE: StorageManager.kt
|
||||
|
||||
trait StorageManager : <!CYCLIC_INHERITANCE_HIERARCHY!>ExceptionTracker<!> {
|
||||
interface StorageManager : <!CYCLIC_INHERITANCE_HIERARCHY!>ExceptionTracker<!> {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait T {
|
||||
interface T {
|
||||
fun component1(): Int
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
trait T {
|
||||
interface T {
|
||||
final fun component1(): Int = 42
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait Expr
|
||||
interface Expr
|
||||
class BinOp(val operator : String) : Expr
|
||||
|
||||
fun test(e : Expr) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait D {
|
||||
interface D {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait D {
|
||||
interface D {
|
||||
fun foo(): String = ""
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ fun f(a: Any?) {
|
||||
}
|
||||
}
|
||||
|
||||
trait B {
|
||||
interface B {
|
||||
fun foo() {}
|
||||
}
|
||||
open class X(<!UNUSED_PARAMETER!>b<!>: B)
|
||||
@@ -1,6 +1,6 @@
|
||||
// KT-2225 Object expression delegation parameter should be checked with data flow info
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
fun foo() : Int
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait G {
|
||||
interface G {
|
||||
fun get(x: Int, y: Int): Int = x + y
|
||||
fun set(x: Int, y: Int, value: Int) {}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
trait A
|
||||
trait B : A {
|
||||
interface A
|
||||
interface B : A {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// KT-2825 DataFlowInfo is not retained after assignment
|
||||
|
||||
trait A
|
||||
interface A
|
||||
|
||||
trait B : A {
|
||||
interface B : A {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait A
|
||||
interface A
|
||||
|
||||
trait B : A
|
||||
interface B : A
|
||||
fun B.compareTo(b: B) = if (this == b) 0 else 1
|
||||
|
||||
fun foo(a: A): Boolean {
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait A
|
||||
trait B : A
|
||||
interface A
|
||||
interface B : A
|
||||
|
||||
fun foo1(a: A, b: B): Boolean {
|
||||
val result = (a as B) == b
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait A
|
||||
interface A
|
||||
|
||||
trait B : A
|
||||
interface B : A
|
||||
fun B.plus(b: B) = if (this == b) b else this
|
||||
|
||||
fun foo(a: A): B {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
trait B {
|
||||
interface B {
|
||||
fun bar() {}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ fun Any?.foo() : Int {
|
||||
}
|
||||
|
||||
|
||||
trait T {}
|
||||
interface T {}
|
||||
|
||||
open class C {
|
||||
fun foo() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
annotation class a
|
||||
trait A
|
||||
trait B
|
||||
interface A
|
||||
interface B
|
||||
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME, CONFLICTING_OVERLOADS!>fun ()<!> {}
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME, CONFLICTING_OVERLOADS!>fun A.()<!> {}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
trait MyTrait {
|
||||
interface MyTrait {
|
||||
fun f1() {}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,5 +15,5 @@
|
||||
<!ILLEGAL_MODIFIER!>final<!> object B4 {}
|
||||
|
||||
<!ILLEGAL_MODIFIER!>override<!> enum class C {}
|
||||
<!ILLEGAL_MODIFIER!>override<!> trait D {}
|
||||
<!ILLEGAL_MODIFIER!>override<!> interface D {}
|
||||
<!ILLEGAL_MODIFIER!>override<!> annotation class E
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package kt1141
|
||||
|
||||
public trait SomeTrait {
|
||||
public interface SomeTrait {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//KT-2397 Prohibit final methods in traits with no implementation
|
||||
package a
|
||||
|
||||
trait T {
|
||||
interface T {
|
||||
<!FINAL_FUNCTION_WITH_NO_BODY!>final<!> fun foo()
|
||||
<!FINAL_PROPERTY_IN_TRAIT!>final<!> val b : Int
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
val prop: Int
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
val prop: Int
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
trait T {
|
||||
interface T {
|
||||
val a: Int <!DELEGATED_PROPERTY_IN_TRAIT!>by Delegate()<!>
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -38,11 +38,11 @@ object O {
|
||||
fun getMyProperty<A, B>() = MyProperty<A, B>()
|
||||
}
|
||||
|
||||
trait MyPropertyContainer {
|
||||
interface MyPropertyContainer {
|
||||
fun <R, T> getMyProperty(): MyProperty<R, T>
|
||||
}
|
||||
|
||||
trait Outer {
|
||||
interface Outer {
|
||||
fun getContainer(): MyPropertyContainer
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package override
|
||||
|
||||
trait T {
|
||||
interface T {
|
||||
fun foo()
|
||||
val v : Int
|
||||
}
|
||||
@@ -21,7 +21,7 @@ class Br2(t : T) : Br1(t) {
|
||||
|
||||
}
|
||||
|
||||
trait G<T> {
|
||||
interface G<T> {
|
||||
fun foo(t : T) : T
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
trait A<T> {
|
||||
interface A<T> {
|
||||
fun foo(): Int
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ open class Foo() {
|
||||
|
||||
class Barrr() : <!DELEGATION_NOT_TO_TRAIT!>Foo<!> by Foo() {}
|
||||
|
||||
trait T {}
|
||||
interface T {}
|
||||
|
||||
class Br(t : T) : T by t {}
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// !DIAGNOSTICS: -CONFLICTING_JVM_DECLARATIONS
|
||||
trait One {
|
||||
interface One {
|
||||
public fun foo(): Any?
|
||||
}
|
||||
trait Two {
|
||||
interface Two {
|
||||
public fun foo(): String?
|
||||
}
|
||||
|
||||
trait Three {
|
||||
interface Three {
|
||||
public fun foo(): String
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait A {
|
||||
interface A {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// !DIAGNOSTICS: -CONFLICTING_JVM_DECLARATIONS
|
||||
trait One {
|
||||
interface One {
|
||||
public open fun foo() : Int
|
||||
private fun boo() = 10
|
||||
}
|
||||
trait Two {
|
||||
interface Two {
|
||||
public open fun foo() : Int
|
||||
}
|
||||
|
||||
trait OneImpl : One {
|
||||
interface OneImpl : One {
|
||||
public override fun foo() = 1
|
||||
}
|
||||
trait TwoImpl : Two {
|
||||
interface TwoImpl : Two {
|
||||
public override fun foo() = 2
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
trait A {
|
||||
interface A {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
trait B : A {}
|
||||
interface B : A {}
|
||||
|
||||
class C(b : B) : B by b {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ open class Obsolete2 [deprecated("Constructor")]() {
|
||||
fun use() {}
|
||||
}
|
||||
|
||||
trait Generic<T>
|
||||
interface Generic<T>
|
||||
|
||||
open class Derived() : <!DEPRECATED_SYMBOL_WITH_MESSAGE!>Obsolete<!>()
|
||||
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
trait B {
|
||||
interface B {
|
||||
fun getX() = 1
|
||||
}
|
||||
|
||||
trait D {
|
||||
interface D {
|
||||
val x: Int
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
trait B {
|
||||
interface B {
|
||||
fun getX() = 1
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,6 +2,6 @@ open class C {
|
||||
val x = 1
|
||||
}
|
||||
|
||||
trait Tr : <!TRAIT_WITH_SUPERCLASS!>C<!> {
|
||||
interface Tr : <!TRAIT_WITH_SUPERCLASS!>C<!> {
|
||||
<!ACCIDENTAL_OVERRIDE!>fun getX()<!> = 1
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
trait T {
|
||||
interface T {
|
||||
fun getX() = 1
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
trait T {
|
||||
interface T {
|
||||
fun getX() = 1
|
||||
}
|
||||
|
||||
trait C : T {
|
||||
interface C : T {
|
||||
val x: Int
|
||||
<!ACCIDENTAL_OVERRIDE!>get()<!> = 1
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
trait T {
|
||||
interface T {
|
||||
fun getX(): Int
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
trait T {
|
||||
interface T {
|
||||
val x: Int
|
||||
get() = 1
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
trait T {
|
||||
interface T {
|
||||
val x: Int
|
||||
get() = 1
|
||||
}
|
||||
|
||||
trait C : T {
|
||||
interface C : T {
|
||||
<!ACCIDENTAL_OVERRIDE!>fun getX()<!> = 1
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
trait T {
|
||||
interface T {
|
||||
val x: Int
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
trait B<T> {
|
||||
interface B<T> {
|
||||
fun foo(t: T) {}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user