File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
main/kotlin/com/tschuchort/compiletesting
test/kotlin/com/tschuchort/compiletesting Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,15 @@ abstract class AbstractKotlinCompilation<A : CommonCompilerArguments> internal c
9191 /* * Use the new experimental K2 compiler */
9292 var useK2: Boolean by default { false }
9393
94+ /* * Enable experimental multiplatform support */
95+ var multiplatform: Boolean = false
96+
97+ /* * Do not check presence of 'actual' modifier in multi-platform projects */
98+ var noCheckActual: Boolean = false
99+
100+ /* * Enable usages of API that requires opt-in with an opt-in requirement marker with the given fully qualified name */
101+ var optIn: List <String >? = null
102+
94103 /* * Additional string arguments to the Kotlin compiler */
95104 var kotlincArguments: List <String > = emptyList()
96105
@@ -130,6 +139,9 @@ abstract class AbstractKotlinCompilation<A : CommonCompilerArguments> internal c
130139 args.reportOutputFiles = reportOutputFiles
131140 args.reportPerf = reportPerformance
132141 args.useK2 = useK2
142+ args.multiPlatform = multiplatform
143+ args.noCheckActual = noCheckActual
144+ args.optIn = optIn?.toTypedArray()
133145
134146 if (languageVersion != null )
135147 args.languageVersion = this .languageVersion
Original file line number Diff line number Diff line change @@ -917,5 +917,18 @@ class KotlinCompilationTests {
917917 assertClassLoadable(result, " KSource" )
918918 }
919919
920+ @Test
921+ fun `can compile code with multi-platform expect modifier` () {
922+ val result = defaultCompilerConfig().apply {
923+ sources = listOf (
924+ SourceFile .kotlin(" kSource1.kt" , " expect interface MppInterface" ),
925+ SourceFile .kotlin(" kSource2.kt" , " actual interface MppInterface" )
926+ )
927+ multiplatform = true
928+ }.compile()
929+
930+ assertThat(result.exitCode).isEqualTo(ExitCode .OK )
931+ }
932+
920933 class InheritedClass {}
921934}
You can’t perform that action at this time.
0 commit comments