Support OptionalExpectation (#2040)
This commit is contained in:
committed by
Nikolay Igotti
parent
88e86cbdd4
commit
d406b1b16d
@@ -2301,6 +2301,15 @@ task mpp_default_args(type: RunStandaloneKonanTest) {
|
||||
flags = ['-tr', '-Xmulti-platform']
|
||||
}
|
||||
|
||||
task mpp_optional_expectation(type: RunStandaloneKonanTest) {
|
||||
source = "codegen/mpp/mpp_optional_expectation.kt"
|
||||
def outputRoot = project.ext."$outputSourceSetName"
|
||||
flags = [
|
||||
'-Xmulti-platform',
|
||||
"-Xcommon-sources=${file("$outputRoot/$name/mpp_optional_expectation.kt")}"
|
||||
]
|
||||
}
|
||||
|
||||
task unit1(type: RunKonanTest) {
|
||||
goldValue = "First\nkotlin.Unit\n"
|
||||
source = "codegen/basics/unit1.kt"
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
@file:Suppress("EXPERIMENTAL_API_USAGE_ERROR")
|
||||
@OptionalExpectation
|
||||
expect annotation class Optional()
|
||||
|
||||
@Optional
|
||||
fun foo() { println(42) }
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
foo()
|
||||
}
|
||||
Reference in New Issue
Block a user