Support OptionalExpectation (#2040)

This commit is contained in:
Ilya Matveev
2018-09-12 17:23:59 +03:00
committed by Nikolay Igotti
parent 88e86cbdd4
commit d406b1b16d
7 changed files with 71 additions and 6 deletions
+9
View File
@@ -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()
}