Add new tests
This commit is contained in:
committed by
Mikhail Bogdanov
parent
0570c05683
commit
0c0bd67a6b
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
// !JVM_DEFAULT_MODE: all-compatibility
|
||||
// JVM_TARGET: 1.8
|
||||
// FULL_JDK
|
||||
// FILE: 1.kt
|
||||
interface KInterface {
|
||||
fun call(): List<String> {
|
||||
return Thread.currentThread().getStackTrace().map { it.className + "." + it.methodName }
|
||||
}
|
||||
|
||||
fun superCall() = Thread.currentThread().getStackTrace().map { it.className + "." + it.methodName }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
interface KInterface2 : KInterface {
|
||||
|
||||
}
|
||||
|
||||
class Foo: KInterface2 {
|
||||
fun superCall2() = super<KInterface2>.superCall()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result = Foo().call()
|
||||
if (result[1] != "KInterface.call") return "fail 1: ${result[1]}"
|
||||
if (result[2] != "MainKt.box") return "fail 2: ${result[2]}"
|
||||
|
||||
result = Foo().superCall2()
|
||||
if (result[1] != "KInterface.superCall") return "fail 1: ${result[1]}"
|
||||
if (result[2] != "Foo.superCall2") return "fail 2: ${result[2]}"
|
||||
if (result[3] != "MainKt.box") return "fail 3: ${result[3]}"
|
||||
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// !JVM_DEFAULT_MODE: all-compatibility
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
interface Test {
|
||||
fun test(): String {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
class TestClass : Test {
|
||||
override fun test(): String {
|
||||
return super.test()
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return TestClass().test()
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// !JVM_DEFAULT_MODE: all-compatibility
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
interface Test {
|
||||
fun test(): String {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
interface Test2 : Test {
|
||||
override fun test(): String {
|
||||
return super.test()
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return object : Test2 {}.test()
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// !JVM_DEFAULT_MODE: all-compatibility
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
interface Test {
|
||||
fun test(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
fun defaultImplTrigger(): String {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
interface Test2 : Test {
|
||||
override fun test(): String {
|
||||
return super.test()
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return object : Test2 {}.test()
|
||||
}
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// !JVM_DEFAULT_MODE: all-compatibility
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
interface Test {
|
||||
val prop: String
|
||||
get() = "OK"
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
class TestClass : Test {
|
||||
override val prop: String
|
||||
get() = super.prop
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return TestClass().prop
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// !JVM_DEFAULT_MODE: all-compatibility
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
interface Test {
|
||||
val prop: String
|
||||
get() = "OK"
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
interface Test2 : Test {
|
||||
override val prop: String
|
||||
get() = super.prop
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return object : Test2 {}.prop
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// !JVM_DEFAULT_MODE: all-compatibility
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
interface Test {
|
||||
val prop: String
|
||||
get() = "OK"
|
||||
|
||||
val defaultImplTrigger: String
|
||||
get() = "OK"
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
interface Test2 : Test {
|
||||
override val prop: String
|
||||
get() = super.prop
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return object : Test2 {}.prop
|
||||
}
|
||||
Reference in New Issue
Block a user