Relax requirements on function modifiers in multiplatform projects
Allow to implement header functions with external/tailrec/inline/infix/operator functions
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// !DIAGNOSTICS: -NOTHING_TO_INLINE
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
header fun external()
|
||||
header fun tailrec()
|
||||
header fun inline()
|
||||
header fun String.unaryMinus(): String
|
||||
header fun String.and(other: String): String
|
||||
|
||||
// MODULE: m2-jvm(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
impl external fun external()
|
||||
impl tailrec fun tailrec(): Unit = if (true) Unit else tailrec()
|
||||
impl inline fun inline() {}
|
||||
impl operator fun String.unaryMinus(): String = this
|
||||
impl infix fun String.and(other: String): String = this + other
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// -- Module: <m1-common> --
|
||||
package
|
||||
|
||||
public header fun external(): kotlin.Unit
|
||||
public header fun inline(): kotlin.Unit
|
||||
public header fun tailrec(): kotlin.Unit
|
||||
public header fun kotlin.String.and(/*0*/ other: kotlin.String): kotlin.String
|
||||
public header fun kotlin.String.unaryMinus(): kotlin.String
|
||||
|
||||
|
||||
// -- Module: <m2-jvm> --
|
||||
package
|
||||
|
||||
public external impl fun external(): kotlin.Unit
|
||||
public inline impl fun inline(): kotlin.Unit
|
||||
public tailrec impl fun tailrec(): kotlin.Unit
|
||||
public infix impl fun kotlin.String.and(/*0*/ other: kotlin.String): kotlin.String
|
||||
public operator impl fun kotlin.String.unaryMinus(): kotlin.String
|
||||
@@ -15,4 +15,4 @@ impl fun nonInlineFun() { }
|
||||
// FILE: js.kt
|
||||
|
||||
impl <!NOTHING_TO_INLINE!>inline<!> fun inlineFun() { }
|
||||
<!IMPLEMENTATION_WITHOUT_HEADER!>impl<!> <!NOTHING_TO_INLINE!>inline<!> fun nonInlineFun() { }
|
||||
impl <!NOTHING_TO_INLINE!>inline<!> fun nonInlineFun() { }
|
||||
|
||||
Reference in New Issue
Block a user