remove support for 'trait' keyword
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
companion object {
|
||||
val OK: String = "OK"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Named {
|
||||
interface Named {
|
||||
companion object Bar {
|
||||
val g = "a";
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
fun bar2(arg: Int = 239): Int
|
||||
|
||||
fun bar(arg: Int = 240): Int = bar2(arg / 2)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait WithName {
|
||||
interface WithName {
|
||||
var name: String
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait WithNumber {
|
||||
interface WithNumber {
|
||||
var number: Int
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Getter<T> {
|
||||
interface Getter<T> {
|
||||
fun get(): T
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// This test was adapted from compiler/testData/codegen/box/classes
|
||||
package foo
|
||||
|
||||
trait Trait1 {
|
||||
interface Trait1 {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
trait Trait2 {
|
||||
interface Trait2 {
|
||||
fun bar(): String
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// This test was adapted from compiler/testData/codegen/box/classes
|
||||
package foo
|
||||
|
||||
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,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Base {
|
||||
interface Base {
|
||||
abstract fun foo(x: String): String
|
||||
var prop: String
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Base {
|
||||
interface Base {
|
||||
abstract fun foo(arg: String): String
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Base {
|
||||
interface Base {
|
||||
abstract fun foo(x: String): String
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Base {
|
||||
interface Base {
|
||||
abstract fun foo(x: String): String
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package foo
|
||||
|
||||
trait Base {
|
||||
interface Base {
|
||||
abstract fun foo(s: String): String
|
||||
var prop: String
|
||||
}
|
||||
|
||||
trait Base1 : Base {
|
||||
interface Base1 : Base {
|
||||
}
|
||||
|
||||
trait Base2 : Base1 {
|
||||
interface Base2 : Base1 {
|
||||
override fun foo(s: String): String = "Base2:foo ${s}"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Base {
|
||||
interface Base {
|
||||
abstract fun foo(x: String): String
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Base {
|
||||
interface Base {
|
||||
abstract fun foo(x: String): String
|
||||
var prop: String
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Base {
|
||||
interface Base {
|
||||
abstract fun foo(x: String): String
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Base {
|
||||
interface Base {
|
||||
abstract fun foo(x: String): String
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ class BaseImpl(val s: String) : Base {
|
||||
override fun foo(x: String): String = "Base: ${s}:${x}"
|
||||
}
|
||||
|
||||
trait Base2 {
|
||||
interface Base2 {
|
||||
abstract fun bar(x: String): String
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Base {
|
||||
interface Base {
|
||||
abstract fun Int.foo(): String
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Base {
|
||||
interface Base {
|
||||
abstract fun String.foo(arg: String): String
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Base {
|
||||
interface Base {
|
||||
var prop: String
|
||||
var Int.foo: String
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package foo
|
||||
|
||||
class State(var value: Int)
|
||||
|
||||
trait Base {
|
||||
interface Base {
|
||||
var State.multiplied: Int
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// This test was adapted from compiler/testData/codegen/box/classes
|
||||
package foo
|
||||
|
||||
trait A<T> {
|
||||
interface A<T> {
|
||||
fun foo(t: T): String
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
// This test was adapted from compiler/testData/codegen/box/classes
|
||||
package foo
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait T {
|
||||
interface T {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,6 @@ enum class MyEnum : T {
|
||||
}
|
||||
}
|
||||
|
||||
trait T {
|
||||
interface T {
|
||||
fun f(): String
|
||||
}
|
||||
@@ -14,7 +14,7 @@ enum class B(open val bar: Int) {
|
||||
var y = 12;
|
||||
}
|
||||
|
||||
trait X {
|
||||
interface X {
|
||||
val foo: Int
|
||||
fun bar(): Int {
|
||||
return foo;
|
||||
|
||||
@@ -2,7 +2,7 @@ open class Base() {
|
||||
fun n(n: Int): Int = n + 1
|
||||
}
|
||||
|
||||
trait Abstract {
|
||||
interface Abstract {
|
||||
}
|
||||
|
||||
class Derived1() : Base(), Abstract {
|
||||
|
||||
@@ -10,7 +10,7 @@ open class Base() {
|
||||
}
|
||||
}
|
||||
|
||||
trait Abstract {
|
||||
interface Abstract {
|
||||
}
|
||||
|
||||
class Derived1() : Base(), Abstract {
|
||||
|
||||
@@ -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,6 +1,6 @@
|
||||
import java.util.ArrayList
|
||||
|
||||
trait Tr {
|
||||
interface Tr {
|
||||
fun extra(): String = "_"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
trait BK {
|
||||
interface BK {
|
||||
fun x(): Int = 50
|
||||
}
|
||||
|
||||
trait K : BK {
|
||||
interface K : BK {
|
||||
override fun x(): Int = super.x() * 2
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
open class X(val x: Int) {
|
||||
}
|
||||
trait Y {
|
||||
interface Y {
|
||||
abstract val y: Int
|
||||
}
|
||||
|
||||
@@ -13,7 +13,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 {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
trait M {
|
||||
interface M {
|
||||
var backingB: Int
|
||||
var b: Int
|
||||
get() = backingB
|
||||
|
||||
Vendored
+1
-1
@@ -5,7 +5,7 @@ public fun foo(): Int = 4
|
||||
public fun boo(): Int = 23
|
||||
fun boo(i: Int): String = "boo" + i
|
||||
|
||||
trait T {
|
||||
interface T {
|
||||
public fun foo(): Int
|
||||
public fun boo(): Int
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ public fun A.boo(): Int = 2
|
||||
val public_ext_f = { A.(): Int -> this.foo() + this.foo }
|
||||
val public_ext_b = { A.(): Int -> this.boo() + this.boo }
|
||||
|
||||
trait TestPublicInTrait {
|
||||
interface TestPublicInTrait {
|
||||
public fun foo(): Int = 2
|
||||
public val foo: Int
|
||||
public val boo: Int
|
||||
@@ -137,7 +137,7 @@ trait TestPublicInTrait {
|
||||
val public_in_trait_f = { obj: TestPublicInTrait -> obj.foo() + obj.foo }
|
||||
val public_in_trait_b = { obj: TestPublicInTrait -> obj.boo() + obj.boo }
|
||||
|
||||
trait TestInternalInTrait {
|
||||
interface TestInternalInTrait {
|
||||
fun foo(): Int = 2
|
||||
val foo: Int
|
||||
val boo: Int
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
package foo
|
||||
|
||||
trait I {
|
||||
interface I {
|
||||
fun test(): String
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
package foo
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
fun foo(i: Int) = "A"
|
||||
}
|
||||
|
||||
trait B {
|
||||
interface B {
|
||||
fun foo(s: String) = "B"
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class Color(r: Int, g: Int, b: Int) : ColorLike {
|
||||
override val blue: Int = b
|
||||
}
|
||||
|
||||
trait ColorLike {
|
||||
interface ColorLike {
|
||||
val red: Int;
|
||||
val green: Int;
|
||||
val blue: Int;
|
||||
|
||||
+6
-6
@@ -1,13 +1,13 @@
|
||||
package foo
|
||||
|
||||
trait A : B, E
|
||||
trait B
|
||||
interface A : B, E
|
||||
interface B
|
||||
open class C {
|
||||
fun foo() = true
|
||||
}
|
||||
trait D
|
||||
trait E
|
||||
trait F : G, D
|
||||
trait G
|
||||
interface D
|
||||
interface E
|
||||
interface F : G, D
|
||||
interface G
|
||||
|
||||
fun box() = C().foo()
|
||||
@@ -8,7 +8,7 @@ package foo
|
||||
import java.util.ArrayList
|
||||
import java.util.HashMap
|
||||
|
||||
trait Element {
|
||||
interface Element {
|
||||
fun render(builder: StringBuilder, indent: String)
|
||||
|
||||
override fun toString(): String {
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ package foo
|
||||
import java.util.ArrayList
|
||||
import java.util.HashMap
|
||||
|
||||
trait Element {
|
||||
interface Element {
|
||||
fun render(builder: StringBuilder, indent: String)
|
||||
|
||||
override fun toString(): String {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
package test
|
||||
|
||||
internal trait InlineTrait {
|
||||
internal interface InlineTrait {
|
||||
|
||||
internal inline final fun finalInline(s: () -> String): String {
|
||||
return s()
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
@native trait HasName {
|
||||
@native interface HasName {
|
||||
val name: String
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
@native trait Summizer {
|
||||
@native interface Summizer {
|
||||
fun sum(a: Int, b: Int): Int
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
@native trait Summizer {
|
||||
@native interface Summizer {
|
||||
fun sum(a: Int, b: Int): Int
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package foo
|
||||
|
||||
trait TraitA
|
||||
trait TraitB
|
||||
interface TraitA
|
||||
interface TraitB
|
||||
|
||||
public open abstract class Node<T : TraitA>() where T : TraitB {
|
||||
public abstract fun bar(arg: T): String
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package foo
|
||||
|
||||
@native
|
||||
trait NativeTrait {
|
||||
interface NativeTrait {
|
||||
val foo: String
|
||||
fun bar(a: Int): Any
|
||||
|
||||
@@ -9,7 +9,7 @@ trait NativeTrait {
|
||||
fun baz(): String
|
||||
}
|
||||
|
||||
trait Trait : NativeTrait
|
||||
interface Trait : NativeTrait
|
||||
|
||||
class Class : NativeTrait {
|
||||
override val foo: String = "Class().foo"
|
||||
|
||||
+3
-3
@@ -1,17 +1,17 @@
|
||||
package foo
|
||||
|
||||
@native
|
||||
trait Chrome {
|
||||
interface Chrome {
|
||||
val extension: Extension
|
||||
}
|
||||
|
||||
@native
|
||||
trait Extension {
|
||||
interface Extension {
|
||||
val lastError: LastError?
|
||||
}
|
||||
|
||||
@native
|
||||
trait LastError {
|
||||
interface LastError {
|
||||
val message: String
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ object Object {
|
||||
}
|
||||
}
|
||||
|
||||
trait Trait {
|
||||
interface Trait {
|
||||
val a: String
|
||||
var b: String
|
||||
fun test(): Int = noImpl
|
||||
@@ -157,7 +157,7 @@ class Class {
|
||||
fun test(): Int = noImpl
|
||||
}
|
||||
|
||||
trait Trait {
|
||||
interface Trait {
|
||||
val a: String
|
||||
var b: String
|
||||
fun test(): Int = noImpl
|
||||
@@ -178,7 +178,7 @@ class Class {
|
||||
}
|
||||
|
||||
@native
|
||||
trait Trait {
|
||||
interface Trait {
|
||||
@native("SomeObject")
|
||||
object Object {
|
||||
val a: String = noImpl
|
||||
@@ -198,7 +198,7 @@ trait Trait {
|
||||
}
|
||||
|
||||
@native("SomeTrait")
|
||||
trait Trait {
|
||||
interface Trait {
|
||||
val a: String
|
||||
var b: String
|
||||
fun test(): Int = noImpl
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Foo {
|
||||
interface Foo {
|
||||
fun execute(handler: () -> Unit) {
|
||||
execute(false, handler)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait I {
|
||||
interface I {
|
||||
fun test(): String
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
val bal: Int
|
||||
get() {
|
||||
return 42
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
package foo
|
||||
|
||||
trait Holder {
|
||||
interface Holder {
|
||||
val element: String
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
package foo
|
||||
|
||||
trait Holder {
|
||||
interface Holder {
|
||||
val element: String
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
package foo
|
||||
|
||||
trait Holder {
|
||||
interface Holder {
|
||||
val element: String
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
package foo
|
||||
|
||||
trait Holder {
|
||||
interface Holder {
|
||||
var element: String
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
val bal: Int
|
||||
get() {
|
||||
return 5
|
||||
@@ -17,7 +17,7 @@ trait A {
|
||||
}
|
||||
|
||||
|
||||
trait B {
|
||||
interface B {
|
||||
val bal: Int
|
||||
get() {
|
||||
return 42
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ class B
|
||||
|
||||
class C : A()
|
||||
|
||||
trait TypePredicate {
|
||||
interface TypePredicate {
|
||||
fun invoke(x: Any): Boolean
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@ package foo
|
||||
|
||||
// CHECK_NOT_CALLED: isInstance
|
||||
|
||||
trait A
|
||||
trait B
|
||||
interface A
|
||||
interface B
|
||||
|
||||
open class C : A, B
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package foo
|
||||
|
||||
open class A
|
||||
|
||||
trait B
|
||||
interface B
|
||||
|
||||
class C : A(), B
|
||||
|
||||
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
package foo
|
||||
|
||||
trait A
|
||||
trait B : A
|
||||
trait C : A
|
||||
trait D : B, C
|
||||
trait E : C
|
||||
interface A
|
||||
interface B : A
|
||||
interface C : A
|
||||
interface D : B, C
|
||||
interface E : C
|
||||
|
||||
open class CB : B
|
||||
class CB2 : CB()
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package foo
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
fun bar(): Int = 2
|
||||
fun foo(t: Int): Int = t + 1
|
||||
}
|
||||
|
||||
trait B : A {
|
||||
interface B : A {
|
||||
override fun bar(): Int = 3
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
package foo
|
||||
|
||||
public trait A {
|
||||
public interface A {
|
||||
fun foo() {
|
||||
}
|
||||
}
|
||||
public trait B : A {
|
||||
public interface B : A {
|
||||
fun boo() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ open class A() {
|
||||
val value = "BAR"
|
||||
}
|
||||
|
||||
trait Test {
|
||||
interface Test {
|
||||
fun addFoo(s: String): String {
|
||||
return s + "FOO"
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ open class A() {
|
||||
val value = "BAR"
|
||||
}
|
||||
|
||||
trait Test {
|
||||
interface Test {
|
||||
fun addFoo(s: String): String {
|
||||
return s + "FOO"
|
||||
}
|
||||
|
||||
@@ -32,16 +32,16 @@ open class A() : F {
|
||||
}
|
||||
}
|
||||
|
||||
trait F : G {
|
||||
interface F : G {
|
||||
fun bar() = "F"
|
||||
}
|
||||
|
||||
// KT-3437
|
||||
trait G : H
|
||||
trait K : H
|
||||
trait L
|
||||
trait H : L
|
||||
trait Dummy
|
||||
interface G : H
|
||||
interface K : H
|
||||
interface L
|
||||
interface H : L
|
||||
interface Dummy
|
||||
|
||||
fun box(): Boolean {
|
||||
return (C().order == "ABC") && (D().order == "ABD") && (E().order == "AE") && (C().bar() == "F") && (A().bar() == "F")
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait AL {
|
||||
interface AL {
|
||||
fun get(index: Int): Any? = null
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ open class Base() {
|
||||
fun n(n: Int): Int = n + 1
|
||||
}
|
||||
|
||||
trait Abstract {
|
||||
interface Abstract {
|
||||
}
|
||||
|
||||
class Derived1() : Base(), Abstract {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package foo
|
||||
|
||||
trait Test {
|
||||
interface Test {
|
||||
fun addFoo(s: String): String {
|
||||
return s + "FOO"
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package foo
|
||||
|
||||
trait Test {
|
||||
interface Test {
|
||||
fun addFoo(s: String): String {
|
||||
return s + "FOO"
|
||||
}
|
||||
}
|
||||
|
||||
trait ExtendedTest : Test {
|
||||
interface ExtendedTest : Test {
|
||||
fun hooray(): String {
|
||||
return "hooray"
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package foo
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
fun addFoo(s: String): String {
|
||||
return s + "FOO"
|
||||
}
|
||||
}
|
||||
|
||||
trait B {
|
||||
interface B {
|
||||
fun hooray(): String {
|
||||
return "hooray"
|
||||
}
|
||||
}
|
||||
|
||||
trait AD : A, B {
|
||||
interface AD : A, B {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ fun main(args: Array<String>) {
|
||||
println(result)
|
||||
}
|
||||
|
||||
trait Element {
|
||||
interface Element {
|
||||
fun render(builder: StringBuilder, indent: String)
|
||||
|
||||
override fun toString(): String {
|
||||
|
||||
Reference in New Issue
Block a user