compiler testdata: s/trait/interface
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user