[Expect/Actual] Add testdata on hierarchical expect/actual matching
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
package sample
|
||||
|
||||
actual class A {
|
||||
actual fun foo(): Int = 45
|
||||
fun fromBottom(): Int = 0
|
||||
}
|
||||
|
||||
fun main() {
|
||||
A().foo()
|
||||
|
||||
// Any behaviour is acceptable, as the code is erroneous.
|
||||
// At the time of writing this test, we resolve to nearest A, i.e.
|
||||
// 'fromBottom' is resolved, and 'fromLeft' is not.
|
||||
A().<!UNRESOLVED_REFERENCE("fromLeft")!>fromLeft<!>()
|
||||
A().fromBottom()
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
MODULE top { platform=[JVM, JS, Native] }
|
||||
MODULE left { platform=[JVM, JS, Native] }
|
||||
MODULE right { platform=[JVM, JS, Native] }
|
||||
MODULE bottom { platform=[JVM] }
|
||||
|
||||
left -> top { kind=DEPENDS_ON }
|
||||
right -> top { kind=DEPENDS_ON }
|
||||
bottom -> left, right { kind=DEPENDS_ON }
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package sample
|
||||
|
||||
actual class A /* Left */ {
|
||||
actual fun foo(): Int = 42
|
||||
fun fromLeft(): String = ""
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
package sample
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package sample
|
||||
|
||||
expect class <!AMBIGUOUS_ACTUALS("Class 'A'", "bottom for JVM, left")!>A<!> {
|
||||
fun <!AMBIGUOUS_ACTUALS("Function 'foo'", "bottom for JVM, left")!>foo<!>(): Int
|
||||
}
|
||||
Reference in New Issue
Block a user