compiler testdata: s/trait/interface

This commit is contained in:
Dmitry Jemerov
2015-05-12 12:38:49 +02:00
parent a5ed5d4269
commit 4bdf598bfe
803 changed files with 1456 additions and 1456 deletions
@@ -23,7 +23,7 @@ final class Final
// Special
annotation class Annotation
enum class Enum
trait Trait
interface Trait
// Deprecation
deprecated("") class Deprecated
@@ -7,5 +7,5 @@ class Generic2<A, B>
class Generic2WithBounds<A, B> where A: Bound1, A: Bound2, B: Generic1<A>
class Bound1
trait Bound2
interface Bound2
@@ -1,6 +1,6 @@
// Derived
trait Base {
interface Base {
fun baz(s: String): String
}
@@ -1,6 +1,6 @@
// Derived
trait Base {
interface Base {
val boo: String
}
@@ -1,6 +1,6 @@
// Generic
trait Generic<N, NN: Any> {
interface Generic<N, NN: Any> {
fun a(n: N): N
fun b(nn: NN): NN
@@ -1,6 +1,6 @@
// C
trait Tr {
interface Tr {
fun foo(): Any
val v: Any
}
@@ -1,6 +1,6 @@
// C
trait Base {
interface Base {
fun foo(): Any
}
@@ -1,6 +1,6 @@
// Primitives
trait Primitives {
interface Primitives {
fun int(x: Int): Int
val nullableBool: Boolean?
@@ -1,6 +1,6 @@
// PrivateInTrait
trait PrivateInTrait {
interface PrivateInTrait {
private var nn: String
get() = ""
set(value) {}
@@ -3,7 +3,7 @@
import org.jetbrains.annotations.NotNull
import org.jetbrains.annotations.Nullable
trait Trait {
interface Trait {
fun notNull(a: String): String
fun nullable(a: String?): String?
@@ -1,6 +1,6 @@
// TraitClassObjectField
trait TraitClassObjectField {
interface TraitClassObjectField {
companion object {
val x: String? = ""
private val y: String? = ""
@@ -1,6 +1,6 @@
// C
trait Base<T> {
interface Base<T> {
fun foo(t: T): T
}
@@ -51,7 +51,7 @@ sink:
<SINK> INIT: in: {foo=ID} out: {foo=ID} USE: in: {} out: {}
=====================
== Foo ==
trait Foo {
interface Foo {
var c: Int
}
---------------------
@@ -11,6 +11,6 @@ fun bar(foo: Foo) {
42
}
trait Foo {
interface Foo {
var c: Int
}
@@ -28,7 +28,7 @@ foo <v3>: {<: Foo} NEW: r(foo) -> <v3>
{ foo.c foo.c = 2 42 } <v5>: * COPY
=====================
== Foo ==
trait Foo {
interface Foo {
var c: Int
}
---------------------
@@ -1,5 +1,5 @@
== T ==
trait T
interface T
---------------------
L0:
1 <START>
@@ -1,4 +1,4 @@
trait T
interface T
class A(a: Int, b: Int): T
@@ -1,5 +1,5 @@
== T ==
trait T
interface T
---------------------
=====================
== A ==
@@ -1,5 +1,5 @@
== A ==
trait A {
interface A {
fun foo() : Int
}
---------------------
@@ -1,4 +1,4 @@
trait A {
interface A {
fun foo() : Int
}
@@ -1,5 +1,5 @@
== A ==
trait A {
interface A {
fun foo() : Int
}
---------------------
@@ -1,7 +1,7 @@
trait A {
interface A {
public val c: Int
}
trait B: A {
interface B: A {
override protected private val c: Int
}
+1 -1
View File
@@ -12,7 +12,7 @@ class A : B() {
fun getB(): Int = 1
val b: Int = 1
trait Tr {
interface Tr {
fun getTr() = 1
}
@@ -1,5 +1,5 @@
package wrong
trait TraitWithDefault {
interface TraitWithDefault {
fun foo() = 1
}
+1 -1
View File
@@ -5,6 +5,6 @@ fun foo(p: Int??) {
}
trait T {
interface T {
abstract fun foo()
}
@@ -2,13 +2,13 @@ open class A {
open fun foo(): Any = "A"
}
trait B : A
interface B : A
open class C : A() {
override fun foo(): Int = 222
}
trait D {
interface D {
fun foo(): Number
}
@@ -5,13 +5,13 @@ abstract class A {
abstract fun foo(): List<String>
}
trait B {
interface B {
fun foo(): ArrayList<String> = ArrayList(Arrays.asList("B"))
}
open class C : A(), B
trait D {
interface D {
fun foo(): Collection<String>
}
@@ -1,4 +1,4 @@
trait A<T> {
interface A<T> {
fun foo(): T
}
@@ -1,4 +1,4 @@
trait A<T> {
interface A<T> {
var result: T
}
@@ -1,10 +1,10 @@
trait A<T, U> {
interface A<T, U> {
fun foo(t: T, u: U) = "A"
}
trait B<U> : A<String, U>
interface B<U> : A<String, U>
trait C<T> : A<T, Int>
interface C<T> : A<T, Int>
class Z : B<Int>, C<String> {
override fun foo(t: String, u: Int) = "Z"
@@ -1,6 +1,6 @@
// KT-4145
trait A {
interface A {
fun foo(): Any
}
@@ -1,8 +1,8 @@
trait A<T> {
interface A<T> {
fun foo(t: T): String
}
trait B {
interface B {
fun foo(t: Int) = "B"
}
@@ -1,8 +1,8 @@
trait A<T> {
interface A<T> {
fun foo(t: T): String
}
trait B<T : Number> {
interface B<T : Number> {
fun foo(a: T) = "B"
}
@@ -1,6 +1,6 @@
// KT-3985
trait Trait<T> {
interface Trait<T> {
fun f(): T
}
@@ -1,8 +1,8 @@
trait A<T> {
interface A<T> {
fun foo(t: T): String
}
trait B {
interface B {
fun foo(t: Int) = "B"
}
@@ -2,11 +2,11 @@ abstract class A {
abstract fun foo(): Any
}
trait B {
interface B {
fun foo(): String = "B"
}
trait C : A, B
interface C : A, B
class D : A(), C
@@ -1,6 +1,6 @@
var result = ""
trait A {
interface A {
var foo: String
get() = result
set(value) {
@@ -1,15 +1,15 @@
var result = ""
trait D1 {
interface D1 {
fun foo(): D1 {
result += "D1"
return this
}
}
trait F2 : D1
interface F2 : D1
trait D3 : F2 {
interface D3 : F2 {
override fun foo(): D3 {
result += "D3"
return this
@@ -1,8 +1,8 @@
trait A {
interface A {
fun foo(): String = "A"
}
trait B {
interface B {
fun foo(): Any
}
@@ -1,12 +1,12 @@
trait D1 {
interface D1 {
fun foo(): Any
}
trait D2 {
interface D2 {
fun foo(): Number
}
trait F3 : D1, D2
interface F3 : D1, D2
open class D4 {
fun foo(): Int = 42
@@ -1,6 +1,6 @@
open data class A(val value: String)
trait B {
interface B {
fun component1(): Any
}
@@ -2,7 +2,7 @@ abstract class Foo<T> {
fun hello(id: T) = "Hi $id"
}
trait Tr {
interface Tr {
fun hello(s : String)
}
@@ -1,10 +1,10 @@
package test
public trait FunDependencyEdge {
public interface FunDependencyEdge {
val from: FunctionNode
}
public trait FunctionNode
public interface FunctionNode
public class FunctionNodeImpl : FunctionNode
@@ -1,4 +1,4 @@
trait Tr<T> {
interface Tr<T> {
val v: T
}
@@ -1,9 +1,9 @@
var result = ""
trait Base
interface Base
open class Child : Base
trait A<T : Base> {
interface A<T : Base> {
fun <E : T> foo(a : E) {
result += "A"
}
@@ -1,4 +1,4 @@
trait A<T, U> {
interface A<T, U> {
fun foo(t: T, u: U) = "A"
}
@@ -1,11 +1,11 @@
import java.util.ArrayList
import java.util.Arrays
trait A {
interface A {
fun foo(): Collection<String>
}
trait B : A {
interface B : A {
override fun foo(): MutableCollection<String>
}
@@ -1,7 +1,7 @@
// TARGET_BACKEND: JVM
import java.util.HashSet
trait A : Set<String>
interface A : Set<String>
class B : A, HashSet<String>() {
override fun clone(): B = throw AssertionError()
@@ -1,11 +1,11 @@
trait A<O, K> {
interface A<O, K> {
val o: O
val k: K
}
trait B<K> : A<String, K>
interface B<K> : A<String, K>
trait C<O> : A<O, String>
interface C<O> : A<O, String>
class D : B<String>, C<String> {
override val o = "O"
@@ -1,4 +1,4 @@
trait A<T> {
interface A<T> {
var x: T
}
@@ -1,4 +1,4 @@
trait A<T> {
interface A<T> {
var v: T
}
@@ -1,4 +1,4 @@
trait A<T> {
interface A<T> {
open fun foo(t: T) = "A"
}
@@ -1,4 +1,4 @@
trait A<T> {
interface A<T> {
fun foo(t: T) = "A"
}
@@ -1,4 +1,4 @@
trait A<T> {
interface A<T> {
fun id(t: T): T
}
@@ -1,8 +1,8 @@
trait A<T> {
interface A<T> {
open fun foo(t: T) = "A"
}
trait B : A<String>
interface B : A<String>
enum class Z(val name: String) : B {
Z1 : Z("Z1")
@@ -1,8 +1,8 @@
trait A {
interface A {
fun foo(): Any = "A"
}
trait B : A {
interface B : A {
override fun foo(): String = "B"
}
@@ -2,7 +2,7 @@ open class A {
open fun foo(): Any = "A"
}
trait B : A {
interface B : A {
override fun foo(): String = "B"
}
@@ -1,8 +1,8 @@
trait A<T> {
interface A<T> {
fun foo(t: T, u: Int) = "A"
}
trait B<T, U> {
interface B<T, U> {
fun foo(t: T, u: U) = "B"
}
@@ -1,8 +1,8 @@
trait A<T> {
interface A<T> {
fun foo(t: T) = "A"
}
trait B<T> {
interface B<T> {
fun foo(t: T) = "B"
}
@@ -1,10 +1,10 @@
trait A : Collection<String>
trait B : List<String>
trait C : Map<Long, Double>
trait D : Map.Entry<Any, Nothing>
trait E : Iterator<Int>
interface A : Collection<String>
interface B : List<String>
interface C : Map<Long, Double>
interface D : Map.Entry<Any, Nothing>
interface E : Iterator<Int>
fun box(): String {
trait F : A, B, C, D, E
interface F : A, B, C, D, E
return "OK"
}
@@ -1,4 +1,4 @@
trait Addable {
interface Addable {
fun add(s: String): Boolean = true
}
@@ -1,6 +1,6 @@
// EA-38323 - Illegal field modifiers in class: classObject field in C must be static and final
trait C {
interface C {
companion object {
public val FOO: String = "OK"
}
@@ -1,8 +1,8 @@
trait Trait1 {
interface Trait1 {
fun foo() : String
}
trait Trait2 {
interface Trait2 {
fun bar() : String
}
@@ -1,8 +1,8 @@
trait One {
interface One {
public open fun foo() : Int
public open fun faz() : Int = 10
}
trait Two {
interface Two {
public open fun foo() : Int
public open fun quux() : Int = 100
}
@@ -1,8 +1,8 @@
open trait First {
open interface First {
public open fun foo() : Int
}
open trait Second : First {
open interface Second : First {
public open fun bar() : Int
}
@@ -1,4 +1,4 @@
trait A<T> {
interface A<T> {
fun foo(t: T): String
}
@@ -1,4 +1,4 @@
trait A<T: Number> {
interface A<T: Number> {
fun foo(t: T): String
}
@@ -1,4 +1,4 @@
trait A<T, U> {
interface A<T, U> {
fun foo(t: T, u: U): String
}
@@ -1,14 +1,14 @@
package test
trait TextField {
interface TextField {
fun getText(): String
}
trait InputTextField : TextField {
interface InputTextField : TextField {
fun setText(text: String)
}
trait MooableTextField : InputTextField {
interface MooableTextField : InputTextField {
fun moo(a: Int, b: Int, c: Int): Int
}
@@ -5,7 +5,7 @@ open class Base() {
}
open class Left() : Base() {}
trait Right : Base {}
interface Right : Base {}
class D() : Left(), Right
@@ -2,7 +2,7 @@ open class Base() {
fun n(n : Int) : Int = n + 1
}
trait Abstract {}
interface Abstract {}
class Derived1() : Base(), Abstract {}
class Derived2() : Abstract, Base() {}
@@ -1,6 +1,6 @@
import java.util.HashSet
trait A : Set<String>
interface A : Set<String>
class B : A, HashSet<String>()
@@ -1,7 +1,7 @@
// Changed when traits were introduced. May not make sense any more
open class X(val x : Int) {}
trait Y {
interface Y {
abstract val y : Int
}
@@ -11,7 +11,7 @@ class Point(x : Int, yy : Int) : X(x) , Y {
override val y : Int = yy
}
trait Abstract {}
interface Abstract {}
class P1(x : Int, yy : Y) : Abstract, X(x), Y by yy {}
class P2(x : Int, yy : Y) : X(x), Abstract, Y by yy {}
@@ -1,10 +1,10 @@
trait Creator<T> {
interface Creator<T> {
fun create() : T
}
class Actor(val code: String = "OK")
trait Factory : Creator<Actor>
interface Factory : Creator<Actor>
class MyFactory() : Factory {
override fun create(): Actor = Actor()
@@ -1,7 +1,7 @@
class Bar {
}
trait Foo {
interface Foo {
fun xyzzy(x: Any?): String
}
@@ -1,4 +1,4 @@
trait A {
interface A {
fun foo(): Int
}
@@ -5,18 +5,18 @@ class JsonObject() {
class JsonArray() {
}
public trait Formatter<in IN: Any, out OUT: Any> {
public interface Formatter<in IN: Any, out OUT: Any> {
public fun format(source: IN?): OUT
}
public trait MultiFormatter <in IN: Any, out OUT: Any> {
public interface MultiFormatter <in IN: Any, out OUT: Any> {
public fun format(source: Collection<IN>): OUT
}
public class Project() {
}
public trait JsonFormatter<in IN: Any>: Formatter<IN, JsonObject>, MultiFormatter<IN, JsonArray> {
public interface JsonFormatter<in IN: Any>: Formatter<IN, JsonObject>, MultiFormatter<IN, JsonArray> {
public override fun format(source: Collection<IN>): JsonArray {
return JsonArray();
}
@@ -1,4 +1,4 @@
public trait LoggerAware {
public interface LoggerAware {
public val logger: StringBuilder
}
@@ -1,11 +1,11 @@
package test
trait A {
interface A {
public val c: String
get() = "OK"
}
trait B {
interface B {
protected val c: String
}
@@ -1,6 +1,6 @@
package foo
trait B {
interface B {
val c: Int
get() = 2
}
@@ -6,7 +6,7 @@ open class B : A() {
override fun foo() = super.foo()
}
trait I
interface I
class C : I, B() {
override fun foo() = super<B>.foo()
@@ -1,4 +1,4 @@
trait Trait {
interface Trait {
fun foo() = "O"
override fun toString() = "K"
}
@@ -1,4 +1,4 @@
trait A {
interface A {
val result: String
}
@@ -1,8 +1,8 @@
trait A {
interface A {
fun foo(): Int
}
trait B {
interface B {
fun foo(): Int
}
@@ -1,12 +1,12 @@
trait A {
interface A {
fun test(): String
}
trait B {
interface B {
fun test(): String
}
trait C: A, B
interface C: A, B
class Z(val param: String): C {
@@ -2,7 +2,7 @@ open class A<T> {
open fun foo(a: T): Int = 2
}
trait B<T> : A<T> {
interface B<T> : A<T> {
override fun foo(a: T): Int = 1
}
@@ -10,7 +10,7 @@ open class Base() {
}
}
trait Abstract {}
interface Abstract {}
class Derived1() : Base(), Abstract {}
class Derived2() : Abstract, Base() {}
@@ -1,6 +1,6 @@
// Changed when traits were introduced. May not make sense any more
trait Left {}
interface Left {}
open class Right() {
open fun f() = 42
}
@@ -1,4 +1,4 @@
trait A<T> {
interface A<T> {
var zzzValue : T
fun zzz() : T
}
@@ -1,4 +1,4 @@
trait T {
interface T {
fun result(): String
}
@@ -1,4 +1,4 @@
trait T {
interface T {
fun result(): String
}
@@ -1,4 +1,4 @@
trait T {
interface T {
fun result(): String
}
@@ -1,4 +1,4 @@
trait T {
interface T {
fun result(): String
}
@@ -1,4 +1,4 @@
trait T {
interface T {
fun result(): String
}
@@ -1,4 +1,4 @@
trait T {
interface T {
fun result(): String
}
@@ -24,7 +24,7 @@ class LI : ListTag() {}
public fun ListTag.item(body: LI.() -> Unit): Unit {}
fun HtmlTag.a(contents: A.() -> Unit) {}
trait A : HtmlTag {
interface A : HtmlTag {
public var text: String
}
@@ -1,6 +1,6 @@
var index = 0
trait IterableIterator : Iterator<Int> {
interface IterableIterator : Iterator<Int> {
fun iterator(): Iterator<Int> = this
}
@@ -1,4 +1,4 @@
trait Foo {
interface Foo {
fun foo(a: Double = 1.0): Double
}
@@ -1,5 +1,5 @@
trait Base {
fun bar(a: String = "abc"): String = a + " from trait"
interface Base {
fun bar(a: String = "abc"): String = a + " from interface"
}
class Derived: Base {
@@ -2,7 +2,7 @@ class Delegate {
fun get(t: Any?, p: PropertyMetadata): Int = 1
}
trait A {
interface A {
val prop: Int
}

Some files were not shown because too many files have changed in this diff Show More