Skip to content

Commit 2daadf6

Browse files
nikitabobkoteamcity
authored and
teamcity
committed
[LIB] Introduce KotlinActual annotation in kotlin-annotations-jvm
KT-67202
1 parent 9f4e039 commit 2daadf6

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
3+
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
4+
*/
5+
6+
package kotlin.annotations.jvm;
7+
8+
import java.lang.annotation.ElementType;
9+
import java.lang.annotation.Retention;
10+
import java.lang.annotation.RetentionPolicy;
11+
import java.lang.annotation.Target;
12+
13+
/**
14+
* Indicates that the Java declaration is an actualization for the existing Kotlin {@code expect} declaration.
15+
* The pair of Kotlin {@code expect} and Java {@code actual} declarations must have the same FQN (fully qualified name)
16+
*
17+
* <p>The annotation can be used only in Java and acts similarly to the {@code actual} keyword in Kotlin.
18+
* Since the annotation is meaningless when used in Kotlin, the Kotlin compiler reports any usages of this annotation in Kotlin code.
19+
*
20+
* <p>Until the feature becomes stable, you need to pass an experimental {@code -Xdirect-java-actualization} flag to the Kotlin compiler.
21+
* You can track the feature stability in the <a href="https://youtrack.jetbrains.com/issue/KT-67202">YouTrack feature request</a>
22+
*
23+
* @see <a href="https://kotlinlang.org/docs/multiplatform-expect-actual.html">Expect and actual declarations documentation</a>
24+
*/
25+
@Retention(RetentionPolicy.SOURCE)
26+
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR})
27+
public @interface KotlinActual {
28+
}

0 commit comments

Comments
 (0)