Add test about resolution to klib from non/common platforms
This commit is contained in:
committed by
Space Team
parent
7f33097634
commit
6c062b0cea
+9
@@ -0,0 +1,9 @@
|
||||
package common
|
||||
|
||||
import some.example.Person
|
||||
|
||||
fun greetEachOther(people: Collection<Person>) {
|
||||
for (person in people) {
|
||||
person.greet()
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package jvmTest
|
||||
|
||||
import common.greetEachOther
|
||||
import some.example.Person
|
||||
|
||||
private class MyPerson(
|
||||
name: String
|
||||
) : Person(name) {
|
||||
override fun greet() = "Hi"
|
||||
}
|
||||
|
||||
fun test() {
|
||||
greetEachOther(
|
||||
listOf(
|
||||
Person("Alice"),
|
||||
MyPerson("Bob"),
|
||||
)
|
||||
)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package some.example
|
||||
|
||||
open class Person(
|
||||
val name: String
|
||||
) {
|
||||
open fun greet() = "Hello"
|
||||
}
|
||||
Reference in New Issue
Block a user