From 056db883c30769ad0b9ae5979d8a3d70169092dd Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Mon, 27 Aug 2018 06:58:23 +0300 Subject: [PATCH] Fix JS IR runtime compilation for tests after applying OptionalExpectation Jvm-specific actuals were removed from stdlib/js runtime. Recreate them in irRuntime so they can be resolved when compiling runtime for IR tests. --- .../kotlin/js/test/BasicIrBoxTest.kt | 2 +- .../js/irRuntime/irTestsJvmAnnotations.kt | 38 +++++++++++++++++++ .../irRuntime/irTestsOptionalExpectation.kt | 7 ++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 libraries/stdlib/js/irRuntime/irTestsJvmAnnotations.kt create mode 100644 libraries/stdlib/js/irRuntime/irTestsOptionalExpectation.kt diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/BasicIrBoxTest.kt b/js/js.tests/test/org/jetbrains/kotlin/js/test/BasicIrBoxTest.kt index 44d82aa75e1..92708d3fe23 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/BasicIrBoxTest.kt +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/BasicIrBoxTest.kt @@ -48,7 +48,7 @@ private val runtimeSources = listOfKtFilesFrom( "core/builtins/native/kotlin/Collections.kt", "core/builtins/native/kotlin/Iterator.kt", - "libraries/stdlib/common/src/kotlin/JvmAnnotationsH.kt", + "libraries/stdlib/common/src/kotlin/JsAnnotationsH.kt", "libraries/stdlib/js/irRuntime", BasicBoxTest.COMMON_FILES_DIR_PATH diff --git a/libraries/stdlib/js/irRuntime/irTestsJvmAnnotations.kt b/libraries/stdlib/js/irRuntime/irTestsJvmAnnotations.kt new file mode 100644 index 00000000000..612e9015d7a --- /dev/null +++ b/libraries/stdlib/js/irRuntime/irTestsJvmAnnotations.kt @@ -0,0 +1,38 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package kotlin.jvm + +import kotlin.annotation.AnnotationTarget.* + +@Target(AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR) +@Retention(AnnotationRetention.SOURCE) +internal annotation class JvmOverloads + +@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FILE) +@Retention(AnnotationRetention.SOURCE) +@MustBeDocumented +internal annotation class JvmName(public val name: String) + +@Target(AnnotationTarget.FILE) +@Retention(AnnotationRetention.SOURCE) +@MustBeDocumented +internal annotation class JvmMultifileClass + +@Target(AnnotationTarget.FIELD) +@Retention(AnnotationRetention.SOURCE) +@MustBeDocumented +internal annotation class JvmField + + +@Target(FIELD) +@MustBeDocumented +@OptionalExpectation +public expect annotation class Volatile() + +@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER) +@MustBeDocumented +@OptionalExpectation +public expect annotation class Synchronized() \ No newline at end of file diff --git a/libraries/stdlib/js/irRuntime/irTestsOptionalExpectation.kt b/libraries/stdlib/js/irRuntime/irTestsOptionalExpectation.kt new file mode 100644 index 00000000000..393f6c501b1 --- /dev/null +++ b/libraries/stdlib/js/irRuntime/irTestsOptionalExpectation.kt @@ -0,0 +1,7 @@ +package kotlin + + +annotation class OptionalExpectationDummy() + +// in order to make the compiler ignore semantics of the real OptionalExpectation +typealias OptionalExpectation = OptionalExpectationDummy \ No newline at end of file