compiler testdata: s/trait/interface
This commit is contained in:
@@ -8,7 +8,7 @@ fun test(foo: Foo) {
|
||||
}
|
||||
|
||||
//variable as member
|
||||
trait A {
|
||||
interface A {
|
||||
val foo: Foo
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ fun test(a: A) {
|
||||
}
|
||||
|
||||
//variable as extension
|
||||
trait B {
|
||||
interface B {
|
||||
}
|
||||
val B.foo: Foo
|
||||
get() = Foo()
|
||||
@@ -36,9 +36,9 @@ fun test(b: B) {
|
||||
}
|
||||
|
||||
//variable as member extension
|
||||
trait C
|
||||
interface C
|
||||
|
||||
trait D {
|
||||
interface D {
|
||||
val C.foo: Foo
|
||||
|
||||
fun test(c: C) {
|
||||
|
||||
@@ -8,7 +8,7 @@ fun test(foo: Foo) {
|
||||
}
|
||||
|
||||
//variable as member
|
||||
trait A {
|
||||
interface A {
|
||||
val foo: Foo
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ fun test(a: A) {
|
||||
}
|
||||
|
||||
//variable as extension
|
||||
trait B {}
|
||||
interface B {}
|
||||
val B.foo: Foo
|
||||
get() = Foo()
|
||||
|
||||
@@ -35,9 +35,9 @@ fun test(b: B) {
|
||||
}
|
||||
|
||||
//variable as member extension
|
||||
trait C
|
||||
interface C
|
||||
|
||||
trait D {
|
||||
interface D {
|
||||
val C.foo: Foo
|
||||
|
||||
fun test(c: C) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Foo
|
||||
|
||||
//no variable
|
||||
trait A {
|
||||
interface A {
|
||||
fun Foo.invoke() {}
|
||||
|
||||
fun test(foo: Foo) {
|
||||
@@ -10,7 +10,7 @@ trait A {
|
||||
}
|
||||
|
||||
//variable as member
|
||||
trait B {
|
||||
interface B {
|
||||
val foo: Foo
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ fun test(c: C, b: B) {
|
||||
|
||||
|
||||
//variable as extension,
|
||||
trait D {
|
||||
interface D {
|
||||
}
|
||||
val D.foo: Foo
|
||||
get() = Foo()
|
||||
@@ -66,9 +66,9 @@ fun test(e: E, d: D) {
|
||||
}
|
||||
|
||||
//variable as member extension
|
||||
trait F
|
||||
interface F
|
||||
|
||||
trait G {
|
||||
interface G {
|
||||
val F.foo: Foo
|
||||
fun Foo.invoke()
|
||||
|
||||
@@ -92,13 +92,13 @@ fun test(g: G, f: F) {
|
||||
}
|
||||
|
||||
//variable as member extension (2)
|
||||
trait X
|
||||
interface X
|
||||
|
||||
trait U {
|
||||
interface U {
|
||||
val X.foo: Foo
|
||||
}
|
||||
|
||||
trait V {
|
||||
interface V {
|
||||
fun Foo.invoke() {}
|
||||
|
||||
fun U.test(x: X) {
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
trait A
|
||||
trait Foo {
|
||||
interface A
|
||||
interface Foo {
|
||||
fun A.invoke()
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ enum class DOMElementTestClasses {
|
||||
|
||||
|
||||
// use case 2
|
||||
trait EnumStyleClass {
|
||||
interface EnumStyleClass {
|
||||
fun invoke() {}
|
||||
}
|
||||
enum class TestClasses : EnumStyleClass {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
trait A
|
||||
interface A
|
||||
|
||||
fun foo(invoke: A.()->Unit, a: A) {
|
||||
a.invoke()
|
||||
|
||||
Reference in New Issue
Block a user