[Expect/Actual] Add testdata on hierarchical expect/actual matching

This commit is contained in:
Dmitry Savvinov
2019-04-23 20:59:07 +03:00
parent cac326bf4a
commit 54b8f9da28
70 changed files with 508 additions and 20 deletions
@@ -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()
}
@@ -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 }
@@ -0,0 +1,6 @@
package sample
actual class A /* Left */ {
actual fun foo(): Int = 42
fun fromLeft(): String = ""
}
@@ -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
}