mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 08:31:29 +00:00
JPS, -Xcommon-sources: write tests
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
c [sourceSetHolder]
|
||||
|
||||
pJvm [compilationAndSourceSetHolder, jvm]
|
||||
pJvm -> c [include]
|
||||
|
||||
pJs [compilationAndSourceSetHolder, js]
|
||||
pJs -> c [include]
|
||||
@@ -0,0 +1,5 @@
|
||||
use @Optional in JS
|
||||
remove @Optional from JS
|
||||
use @Optional in JVM
|
||||
remove @Optional from JVM
|
||||
add another @Optional in Common module
|
||||
@@ -0,0 +1,62 @@
|
||||
================ Step #1 use @Optional in JS =================
|
||||
|
||||
Building c
|
||||
Building pJs
|
||||
Compiling files:
|
||||
pJs/src/c.kt
|
||||
End of files
|
||||
Exit code: ABORT
|
||||
------------------------------------------
|
||||
COMPILATION FAILED
|
||||
Declaration annotated with '@OptionalExpectation' can only be used in common module sources
|
||||
|
||||
================ Step #2 remove @Optional from JS =================
|
||||
|
||||
Building c
|
||||
Building pJs
|
||||
Exit code: NOTHING_DONE
|
||||
------------------------------------------
|
||||
Building pJvm
|
||||
Exit code: NOTHING_DONE
|
||||
------------------------------------------
|
||||
|
||||
================ Step #3 use @Optional in JVM =================
|
||||
|
||||
Building c
|
||||
Building pJs
|
||||
Exit code: NOTHING_DONE
|
||||
------------------------------------------
|
||||
Building pJvm
|
||||
Compiling files:
|
||||
pJvm/src/c.kt
|
||||
End of files
|
||||
Exit code: ABORT
|
||||
------------------------------------------
|
||||
COMPILATION FAILED
|
||||
Declaration annotated with '@OptionalExpectation' can only be used in common module sources
|
||||
|
||||
================ Step #4 remove @Optional from JVM =================
|
||||
|
||||
Building c
|
||||
Building pJs
|
||||
Exit code: NOTHING_DONE
|
||||
------------------------------------------
|
||||
Building pJvm
|
||||
Exit code: NOTHING_DONE
|
||||
------------------------------------------
|
||||
|
||||
================ Step #5 add another @Optional in Common module =================
|
||||
|
||||
Building c
|
||||
Building pJs
|
||||
Compiling files:
|
||||
c/src/b.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
Building pJvm
|
||||
Compiling files:
|
||||
c/src/b.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
@@ -0,0 +1,7 @@
|
||||
@file:Suppress("EXPERIMENTAL_API_USAGE_ERROR")
|
||||
|
||||
@OptionalExpectation
|
||||
expect annotation class Optional(val value: String)
|
||||
|
||||
@Optional("Foo")
|
||||
class Foo
|
||||
@@ -0,0 +1,2 @@
|
||||
@Optional("Foo")
|
||||
class Bar
|
||||
@@ -0,0 +1,3 @@
|
||||
// Should be an error: Declaration annotated with '@OptionalExpectation' can only be used in common module sources
|
||||
@Optional("BarJs")
|
||||
class BarJs
|
||||
@@ -0,0 +1,3 @@
|
||||
// Should be an error: Declaration annotated with '@OptionalExpectation' can only be used in common module sources
|
||||
@Optional("BarJvm")
|
||||
class BarJvm
|
||||
Reference in New Issue
Block a user