remove support for 'trait' keyword
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
trait Id<T> {
|
||||
interface Id<T> {
|
||||
val id: T
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait A {
|
||||
interface A {
|
||||
fun visit(a:String, b:String="") : String = b + a
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait Base
|
||||
interface Base
|
||||
class Derived: Base
|
||||
class Another: Base
|
||||
fun Base.inc(): Derived { return Derived() }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait Base
|
||||
interface Base
|
||||
class Derived: Base
|
||||
class Another: Base
|
||||
fun Base.inc(): Derived { return Derived() }
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// KT-3407 Implementing (in Java) an abstract Kotlin class that implements a trait does not respect trait method definition
|
||||
|
||||
trait T {
|
||||
interface T {
|
||||
fun foo() = "OK"
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
trait KTrait : Simple {
|
||||
interface KTrait : Simple {
|
||||
fun bar(): String {
|
||||
return test("O") + Simple.testStatic("O")
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
trait KTrait: Simple {
|
||||
interface KTrait: Simple {
|
||||
override fun test(s: String): String {
|
||||
return s + "K"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait KTrait {
|
||||
interface KTrait {
|
||||
fun test(): String {
|
||||
return "base";
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait KTrait : Test {
|
||||
interface KTrait : Test {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
<!DEPRECATED_TRAIT_KEYWORD!>trait<!> A {
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package
|
||||
|
||||
public interface A {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+1
-1
@@ -2,6 +2,6 @@ package test
|
||||
|
||||
annotation class A
|
||||
|
||||
trait Foo<T : @A Number> : @A CharSequence {
|
||||
interface Foo<T : @A Number> : @A CharSequence {
|
||||
fun <E, F : @A E> bar()
|
||||
}
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ fun func() {}
|
||||
class C
|
||||
|
||||
@file:
|
||||
trait T
|
||||
interface T
|
||||
|
||||
@file:[]
|
||||
trait T
|
||||
interface T
|
||||
+2
-2
@@ -85,7 +85,7 @@ JetFile: fileAnnotationInWrongPlace.kt
|
||||
PsiElement(IDENTIFIER)('file')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(trait)('trait')
|
||||
PsiElement(interface)('interface')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiWhiteSpace('\n\n')
|
||||
@@ -101,6 +101,6 @@ JetFile: fileAnnotationInWrongPlace.kt
|
||||
<empty list>
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(trait)('trait')
|
||||
PsiElement(interface)('interface')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
trait A1() {
|
||||
interface A1() {
|
||||
constructor(x: Int = "", y: Int) : this() {
|
||||
x + y
|
||||
}
|
||||
}
|
||||
|
||||
trait A2 private constructor(private val prop: Int) {
|
||||
interface A2 private constructor(private val prop: Int) {
|
||||
constructor(x: Int = "", y: Int) : this(x * y) {
|
||||
x + y
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user