Migration to expect/actual: fix multiplatform integration tests

This commit is contained in:
Mikhail Glukhikh
2017-09-15 10:44:43 +03:00
parent 27615209ed
commit 85d6a4d1af
65 changed files with 394 additions and 394 deletions
@@ -1,34 +1,34 @@
header fun f1()
expect fun f1()
header fun f2(name: String)
expect fun f2(name: String)
header fun f3(name: String)
header fun String.f3ext()
expect fun f3(name: String)
expect fun String.f3ext()
header fun f4(name: String)
expect fun f4(name: String)
header fun String.f5()
expect fun String.f5()
header fun f6(p1: String, p2: Int)
expect fun f6(p1: String, p2: Int)
header fun <T> f7()
expect fun <T> f7()
internal header fun f8()
private header fun f9()
public header fun f10()
internal expect fun f8()
private expect fun f9()
public expect fun f10()
header fun <T : Number> f11()
header fun <U : MutableList<String>> f12()
header fun <A, B : Comparable<A>> f13()
expect fun <T : Number> f11()
expect fun <U : MutableList<String>> f12()
expect fun <A, B : Comparable<A>> f13()
header inline fun <X> f14()
header inline fun <reified Y> f15()
expect inline fun <X> f14()
expect inline fun <reified Y> f15()
header fun f16(s: String)
expect fun f16(s: String)
header fun f17(vararg s: String)
header fun f18(s: Array<out String>)
header inline fun f19(s: () -> Unit)
header inline fun f20(s: () -> Unit)
header fun f21(c: suspend Unit.() -> Unit)
header fun f22(c: Unit.() -> Unit)
expect fun f17(vararg s: String)
expect fun f18(s: Array<out String>)
expect inline fun f19(s: () -> Unit)
expect inline fun f20(s: () -> Unit)
expect fun f21(c: suspend Unit.() -> Unit)
expect fun f22(c: Unit.() -> Unit)
+23 -23
View File
@@ -1,34 +1,34 @@
impl fun f1(): String = ""
actual fun f1(): String = ""
impl fun f2(otherName: String) {}
actual fun f2(otherName: String) {}
impl fun f3(name: Double) {}
impl fun Double.f3ext() {}
actual fun f3(name: Double) {}
actual fun Double.f3ext() {}
impl fun String.f4() {}
actual fun String.f4() {}
impl fun f5(name: String) {}
actual fun f5(name: String) {}
impl fun f6(p2: Int) {}
actual fun f6(p2: Int) {}
impl fun <K, V> f7() {}
actual fun <K, V> f7() {}
public impl fun f8() {}
internal impl fun f9() {}
private impl fun f10() {}
public actual fun f8() {}
internal actual fun f9() {}
private actual fun f10() {}
impl fun <T : Annotation> f11() {}
impl fun <U : MutableList<out String>> f12() {}
impl fun <A, B : Comparable<B>> f13() {}
actual fun <T : Annotation> f11() {}
actual fun <U : MutableList<out String>> f12() {}
actual fun <A, B : Comparable<B>> f13() {}
impl inline fun <reified X> f14() {}
impl inline fun <Y> f15() {}
actual inline fun <reified X> f14() {}
actual inline fun <Y> f15() {}
impl fun f16(s: String = "") {}
actual fun f16(s: String = "") {}
impl fun f17(s: Array<out String>) {}
impl fun f18(vararg s: String) {}
impl inline fun f19(crossinline s: () -> Unit) {}
impl inline fun f20(noinline s: () -> Unit) {}
impl fun f21(c: Unit.() -> Unit) {}
impl fun f22(c: suspend Unit.() -> Unit) {}
actual fun f17(s: Array<out String>) {}
actual fun f18(vararg s: String) {}
actual inline fun f19(crossinline s: () -> Unit) {}
actual inline fun f20(noinline s: () -> Unit) {}
actual fun f21(c: Unit.() -> Unit) {}
actual fun f22(c: suspend Unit.() -> Unit) {}
@@ -2,7 +2,7 @@
Exit code: OK
Output:
compiler/testData/multiplatform/incompatibleCallables/common.kt:33:19: warning: the feature "coroutines" is experimental (see: https://kotlinlang.org/docs/diagnostics/experimental-coroutines)
header fun f21(c: suspend Unit.() -> Unit)
expect fun f21(c: suspend Unit.() -> Unit)
^
-- JVM --
@@ -10,115 +10,115 @@ Exit code: COMPILATION_ERROR
Output:
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:1:1: error: 'impl' function 'f1' has no corresponding 'header' declaration
The following declaration is incompatible because return type is different:
public header fun f1(): Unit
public expect fun f1(): Unit
impl fun f1(): String = ""
actual fun f1(): String = ""
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:3:1: error: 'impl' function 'f2' has no corresponding 'header' declaration
The following declaration is incompatible because parameter names are different:
public header fun f2(name: String): Unit
public expect fun f2(name: String): Unit
impl fun f2(otherName: String) {}
actual fun f2(otherName: String) {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:5:1: error: 'impl' function 'f3' has no corresponding 'header' declaration
The following declaration is incompatible because parameter types are different:
public header fun f3(name: String): Unit
public expect fun f3(name: String): Unit
impl fun f3(name: Double) {}
actual fun f3(name: Double) {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:6:1: error: 'impl' function 'f3ext' has no corresponding 'header' declaration
The following declaration is incompatible because parameter types are different:
public header fun String.f3ext(): Unit
public expect fun String.f3ext(): Unit
impl fun Double.f3ext() {}
actual fun Double.f3ext() {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:8:1: error: 'impl' function 'f4' has no corresponding 'header' declaration
The following declaration is incompatible because parameter shapes are different (extension vs non-extension):
public header fun f4(name: String): Unit
public expect fun f4(name: String): Unit
impl fun String.f4() {}
actual fun String.f4() {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:10:1: error: 'impl' function 'f5' has no corresponding 'header' declaration
The following declaration is incompatible because parameter shapes are different (extension vs non-extension):
public header fun String.f5(): Unit
public expect fun String.f5(): Unit
impl fun f5(name: String) {}
actual fun f5(name: String) {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:12:1: error: 'impl' function 'f6' has no corresponding 'header' declaration
The following declaration is incompatible because number of value parameters is different:
public header fun f6(p1: String, p2: Int): Unit
public expect fun f6(p1: String, p2: Int): Unit
impl fun f6(p2: Int) {}
actual fun f6(p2: Int) {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:14:1: error: 'impl' function 'f7' has no corresponding 'header' declaration
The following declaration is incompatible because number of type parameters is different:
public header fun <T> f7(): Unit
public expect fun <T> f7(): Unit
impl fun <K, V> f7() {}
actual fun <K, V> f7() {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:16:1: error: 'impl' function 'f8' has no corresponding 'header' declaration
The following declaration is incompatible because visibility is different:
internal header fun f8(): Unit
internal expect fun f8(): Unit
public impl fun f8() {}
public actual fun f8() {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:17:1: error: 'impl' function 'f9' has no corresponding 'header' declaration
The following declaration is incompatible because visibility is different:
private header fun f9(): Unit
private expect fun f9(): Unit
internal impl fun f9() {}
internal actual fun f9() {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:18:1: error: 'impl' function 'f10' has no corresponding 'header' declaration
The following declaration is incompatible because visibility is different:
public header fun f10(): Unit
public expect fun f10(): Unit
private impl fun f10() {}
private actual fun f10() {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:24:1: error: 'impl' function 'f14' has no corresponding 'header' declaration
The following declaration is incompatible because some type parameter is reified in one declaration and non-reified in the other:
public header inline fun <X> f14(): Unit
public expect inline fun <X> f14(): Unit
impl inline fun <reified X> f14() {}
actual inline fun <reified X> f14() {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:27:1: error: 'impl' function 'f16' has no corresponding 'header' declaration
The following declaration is incompatible because some parameters have default values:
public header fun f16(s: String): Unit
public expect fun f16(s: String): Unit
impl fun f16(s: String = "") {}
actual fun f16(s: String = "") {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:29:1: error: 'impl' function 'f17' has no corresponding 'header' declaration
The following declaration is incompatible because some value parameter is vararg in one declaration and non-vararg in the other:
public header fun f17(vararg s: String): Unit
public expect fun f17(vararg s: String): Unit
impl fun f17(s: Array<out String>) {}
actual fun f17(s: Array<out String>) {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:30:1: error: 'impl' function 'f18' has no corresponding 'header' declaration
The following declaration is incompatible because some value parameter is vararg in one declaration and non-vararg in the other:
public header fun f18(s: Array<out String>): Unit
public expect fun f18(s: Array<out String>): Unit
impl fun f18(vararg s: String) {}
actual fun f18(vararg s: String) {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:31:1: error: 'impl' function 'f19' has no corresponding 'header' declaration
The following declaration is incompatible because some value parameter is crossinline in one declaration and not crossinline in the other:
public header inline fun f19(s: () -> Unit): Unit
public expect inline fun f19(s: () -> Unit): Unit
impl inline fun f19(crossinline s: () -> Unit) {}
actual inline fun f19(crossinline s: () -> Unit) {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:32:1: error: 'impl' function 'f20' has no corresponding 'header' declaration
The following declaration is incompatible because some value parameter is noinline in one declaration and not noinline in the other:
public header inline fun f20(s: () -> Unit): Unit
public expect inline fun f20(s: () -> Unit): Unit
impl inline fun f20(noinline s: () -> Unit) {}
actual inline fun f20(noinline s: () -> Unit) {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:33:1: error: 'impl' function 'f21' has no corresponding 'header' declaration
The following declaration is incompatible because parameter types are different:
public header fun f21(c: suspend Unit.() -> Unit): Unit
public expect fun f21(c: suspend Unit.() -> Unit): Unit
impl fun f21(c: Unit.() -> Unit) {}
actual fun f21(c: Unit.() -> Unit) {}
^
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:34:1: error: 'impl' function 'f22' has no corresponding 'header' declaration
The following declaration is incompatible because parameter types are different:
public header fun f22(c: Unit.() -> Unit): Unit
public expect fun f22(c: Unit.() -> Unit): Unit
impl fun f22(c: suspend Unit.() -> Unit) {}
actual fun f22(c: suspend Unit.() -> Unit) {}
^