[Tests] Migrate backend-independent tests from native to compiler/testData.
^KT-65979
This commit is contained in:
committed by
Space Team
parent
dd9332d9e1
commit
febac0dd5f
@@ -0,0 +1,32 @@
|
||||
// WITH_STDLIB
|
||||
// MODULE: lib
|
||||
// FILE: lib.kt
|
||||
|
||||
package a
|
||||
|
||||
interface A<T> {
|
||||
fun foo(): T
|
||||
}
|
||||
|
||||
open class C: A<Int> {
|
||||
override fun foo(): Int = 42
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: main.kt
|
||||
|
||||
import a.*
|
||||
import kotlin.test.*
|
||||
|
||||
class B: C()
|
||||
|
||||
fun box(): String {
|
||||
val b = B()
|
||||
assertEquals(42, b.foo())
|
||||
val c: C = b
|
||||
assertEquals(42, c.foo())
|
||||
val a: A<Int> = b
|
||||
assertEquals(42, a.foo())
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user