[FE] Prohibit expect external and expect tailrec

^KT-58536 Fixed
This commit is contained in:
Roman Efremov
2023-05-17 16:08:33 +02:00
committed by Space Team
parent e6d5df18b8
commit 439cc88525
26 changed files with 298 additions and 34 deletions
@@ -2,8 +2,4 @@ expect infix fun Int.plus(s: CharSequence): Int
expect operator fun Double.times(x: CharArray)
expect external fun f1()
expect inline fun f2()
expect tailrec fun f3()
expect inline fun f1()
@@ -3,7 +3,3 @@ actual fun Int.plus(s: CharSequence): Int = 0
actual fun Double.times(x: CharArray) {}
actual fun f1() {}
actual fun f2() {}
actual fun f3() {}
@@ -6,32 +6,20 @@ Output:
Exit code: COMPILATION_ERROR
Output:
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:1:1: error: actual function 'plus' has no corresponding expected declaration
The following declaration is incompatible because some modifiers on expected declaration are missing on the actual one (external, infix, inline, operator, tailrec):
The following declaration is incompatible because some modifiers on expected declaration are missing on the actual one (infix, inline, operator):
public expect infix fun Int.plus(s: CharSequence): Int
actual fun Int.plus(s: CharSequence): Int = 0
^
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:3:1: error: actual function 'times' has no corresponding expected declaration
The following declaration is incompatible because some modifiers on expected declaration are missing on the actual one (external, infix, inline, operator, tailrec):
The following declaration is incompatible because some modifiers on expected declaration are missing on the actual one (infix, inline, operator):
public expect operator fun Double.times(x: CharArray): Unit
actual fun Double.times(x: CharArray) {}
^
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:5:1: error: actual function 'f1' has no corresponding expected declaration
The following declaration is incompatible because some modifiers on expected declaration are missing on the actual one (external, infix, inline, operator, tailrec):
public external expect fun f1(): Unit
The following declaration is incompatible because some modifiers on expected declaration are missing on the actual one (infix, inline, operator):
public expect inline fun f1(): Unit
actual fun f1() {}
^
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:7:1: error: actual function 'f2' has no corresponding expected declaration
The following declaration is incompatible because some modifiers on expected declaration are missing on the actual one (external, infix, inline, operator, tailrec):
public expect inline fun f2(): Unit
actual fun f2() {}
^
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:9:1: error: actual function 'f3' has no corresponding expected declaration
The following declaration is incompatible because some modifiers on expected declaration are missing on the actual one (external, infix, inline, operator, tailrec):
public expect tailrec fun f3(): Unit
actual fun f3() {}
^