Drop Experimental.Impact, simplify related code and tests
See https://github.com/Kotlin/KEEP/issues/95#issuecomment-383889404 Drop Experimental.changesMayBreak, Experimental.Impact, the concept of signature/body usage, same module exemption. Make the majority of tests single-module because there is now no difference in the checker between usages from the same module or from another module
This commit is contained in:
@@ -234,16 +234,14 @@ public interface Errors {
|
||||
DiagnosticFactory1<PsiElement, FqName> ILLEGAL_KOTLIN_VERSION_STRING_VALUE = DiagnosticFactory1.create(ERROR);
|
||||
DiagnosticFactory1<PsiElement, String> NEWER_VERSION_IN_SINCE_KOTLIN = DiagnosticFactory1.create(WARNING);
|
||||
|
||||
DiagnosticFactory2<PsiElement, FqName, Boolean> EXPERIMENTAL_API_USAGE = DiagnosticFactory2.create(WARNING);
|
||||
DiagnosticFactory2<PsiElement, FqName, Boolean> EXPERIMENTAL_API_USAGE_ERROR = DiagnosticFactory2.create(ERROR);
|
||||
DiagnosticFactory1<PsiElement, FqName> EXPERIMENTAL_API_USAGE = DiagnosticFactory1.create(WARNING);
|
||||
DiagnosticFactory1<PsiElement, FqName> EXPERIMENTAL_API_USAGE_ERROR = DiagnosticFactory1.create(ERROR);
|
||||
|
||||
DiagnosticFactory2<PsiElement, FqName, DeclarationDescriptor> EXPERIMENTAL_OVERRIDE = DiagnosticFactory2.create(WARNING);
|
||||
DiagnosticFactory2<PsiElement, FqName, DeclarationDescriptor> EXPERIMENTAL_OVERRIDE_ERROR = DiagnosticFactory2.create(ERROR);
|
||||
|
||||
DiagnosticFactory0<KtAnnotationEntry> USE_EXPERIMENTAL_WITHOUT_ARGUMENTS = DiagnosticFactory0.create(WARNING);
|
||||
DiagnosticFactory1<KtAnnotationEntry, FqName> USE_EXPERIMENTAL_ARGUMENT_IS_NOT_MARKER = DiagnosticFactory1.create(WARNING);
|
||||
DiagnosticFactory1<KtAnnotationEntry, FqName> USE_EXPERIMENTAL_ARGUMENT_HAS_NON_COMPILATION_IMPACT = DiagnosticFactory1.create(ERROR);
|
||||
DiagnosticFactory0<KtAnnotationEntry> EXPERIMENTAL_ANNOTATION_WITH_NO_IMPACT = DiagnosticFactory0.create(ERROR);
|
||||
DiagnosticFactory1<KtAnnotationEntry, String> EXPERIMENTAL_ANNOTATION_WITH_WRONG_TARGET = DiagnosticFactory1.create(ERROR);
|
||||
|
||||
// Const
|
||||
|
||||
+2
-15
@@ -15,7 +15,6 @@ import org.jetbrains.kotlin.diagnostics.Diagnostic;
|
||||
import org.jetbrains.kotlin.diagnostics.DiagnosticFactory;
|
||||
import org.jetbrains.kotlin.diagnostics.Errors;
|
||||
import org.jetbrains.kotlin.metadata.deserialization.VersionRequirement;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
import org.jetbrains.kotlin.resolve.VarianceConflictDiagnosticData;
|
||||
import org.jetbrains.kotlin.types.KotlinTypeKt;
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions;
|
||||
@@ -23,7 +22,6 @@ import org.jetbrains.kotlin.utils.addToStdlib.AddToStdlibKt;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.ServiceLoader;
|
||||
@@ -142,25 +140,14 @@ public class DefaultErrorMessages {
|
||||
MAP.put(ILLEGAL_KOTLIN_VERSION_STRING_VALUE, "Invalid @{0} annotation value (should be ''major.minor'' or ''major.minor.patch'')", TO_STRING);
|
||||
MAP.put(NEWER_VERSION_IN_SINCE_KOTLIN, "The version is greater than the specified API version {0}", STRING);
|
||||
|
||||
RenderingContext.Key<FqName> getExperimentalFqName = new RenderingContext.Key<FqName>("getExperimentalFqName") {
|
||||
@Override
|
||||
public FqName compute(@NotNull Collection<?> objectsToRender) {
|
||||
return (FqName) CollectionsKt.first(objectsToRender);
|
||||
}
|
||||
};
|
||||
DiagnosticParameterRenderer<Boolean> renderUseExperimental = (useExperimentalAllowed, c) ->
|
||||
useExperimentalAllowed ? " or ''@UseExperimental(" + c.get(getExperimentalFqName) + "::class)''" : "";
|
||||
MAP.put(EXPERIMENTAL_API_USAGE, "This declaration is experimental and its usage should be marked with ''@{0}''{1}", TO_STRING, renderUseExperimental);
|
||||
MAP.put(EXPERIMENTAL_API_USAGE_ERROR, "This declaration is experimental and its usage must be marked with ''@{0}''{1}", TO_STRING, renderUseExperimental);
|
||||
MAP.put(EXPERIMENTAL_API_USAGE, "This declaration is experimental and its usage should be marked with ''@{0}'' or ''@UseExperimental({0}::class)''", TO_STRING);
|
||||
MAP.put(EXPERIMENTAL_API_USAGE_ERROR, "This declaration is experimental and its usage must be marked with ''@{0}'' or ''@UseExperimental({0}::class)''", TO_STRING);
|
||||
|
||||
MAP.put(EXPERIMENTAL_OVERRIDE, "This declaration overrides experimental member of supertype ''{1}'' and should be annotated with ''@{0}''", TO_STRING, NAME);
|
||||
MAP.put(EXPERIMENTAL_OVERRIDE_ERROR, "This declaration overrides experimental member of supertype ''{1}'' and must be annotated with ''@{0}''", TO_STRING, NAME);
|
||||
|
||||
MAP.put(USE_EXPERIMENTAL_WITHOUT_ARGUMENTS, "@UseExperimental without any arguments has no effect");
|
||||
MAP.put(USE_EXPERIMENTAL_ARGUMENT_IS_NOT_MARKER, "Annotation ''{0}'' is not an experimental API marker, therefore its usage in @UseExperimental is ignored", TO_STRING);
|
||||
MAP.put(USE_EXPERIMENTAL_ARGUMENT_HAS_NON_COMPILATION_IMPACT,
|
||||
"Experimental annotation ''{0}'' has impact other than COMPILATION, therefore its usage in @UseExperimental is forbidden", TO_STRING);
|
||||
MAP.put(EXPERIMENTAL_ANNOTATION_WITH_NO_IMPACT, "Experimental annotation with changesMayBreak = [] is not allowed");
|
||||
MAP.put(EXPERIMENTAL_ANNOTATION_WITH_WRONG_TARGET, "Experimental annotation cannot be used on the following code elements: {0}. Please remove these targets", STRING);
|
||||
|
||||
MAP.put(REDUNDANT_MODIFIER, "Modifier ''{0}'' is redundant because ''{1}'' is present", TO_STRING, TO_STRING);
|
||||
|
||||
+2
-13
@@ -34,8 +34,6 @@ object ExperimentalMarkerDeclarationAnnotationChecker : AdditionalAnnotationChec
|
||||
checkUseExperimentalUsage(annotationClasses, trace, entry)
|
||||
}
|
||||
ExperimentalUsageChecker.EXPERIMENTAL_FQ_NAME -> {
|
||||
val impact = (annotation.allValueArguments[ExperimentalUsageChecker.IMPACT] as? ArrayValue)?.value
|
||||
checkExperimentalUsage(impact, trace, entry)
|
||||
isAnnotatedWithExperimental = true
|
||||
}
|
||||
}
|
||||
@@ -54,31 +52,22 @@ object ExperimentalMarkerDeclarationAnnotationChecker : AdditionalAnnotationChec
|
||||
|
||||
for (annotationClass in annotationClasses) {
|
||||
val classDescriptor =
|
||||
(annotationClass as? KClassValue)?.value?.constructor?.declarationDescriptor as? ClassDescriptor
|
||||
?: continue
|
||||
(annotationClass as? KClassValue)?.value?.constructor?.declarationDescriptor as? ClassDescriptor ?: continue
|
||||
val experimentality = with(ExperimentalUsageChecker) {
|
||||
classDescriptor.loadExperimentalityForMarkerAnnotation()
|
||||
}
|
||||
if (experimentality == null) {
|
||||
trace.report(Errors.USE_EXPERIMENTAL_ARGUMENT_IS_NOT_MARKER.on(entry, classDescriptor.fqNameSafe))
|
||||
} else if (!experimentality.isCompilationOnly) {
|
||||
trace.report(Errors.USE_EXPERIMENTAL_ARGUMENT_HAS_NON_COMPILATION_IMPACT.on(entry, experimentality.annotationFqName))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkExperimentalUsage(impact: List<ConstantValue<*>>?, trace: BindingTrace, entry: KtAnnotationEntry) {
|
||||
if (impact != null && impact.isEmpty()) {
|
||||
trace.report(Errors.EXPERIMENTAL_ANNOTATION_WITH_NO_IMPACT.on(entry))
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkMarkerTargets(entries: List<KtAnnotationEntry>, trace: BindingTrace) {
|
||||
val targetEntry =
|
||||
entries.associate { entry -> entry to trace.bindingContext.get(BindingContext.ANNOTATION, entry) }
|
||||
.entries
|
||||
.firstOrNull { (_, descriptor) -> descriptor != null && descriptor.fqName == KotlinBuiltIns.FQ_NAMES.target }
|
||||
?: return
|
||||
?: return
|
||||
val (entry, descriptor) = targetEntry
|
||||
val allowedTargets = AnnotationChecker.loadAnnotationTargets(descriptor!!) ?: return
|
||||
val wrongTargets = allowedTargets.intersect(WRONG_TARGETS_FOR_MARKER)
|
||||
|
||||
+24
-96
@@ -26,7 +26,9 @@ import org.jetbrains.kotlin.diagnostics.Errors
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.KtAnnotated
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtNamedDeclaration
|
||||
import org.jetbrains.kotlin.resolve.*
|
||||
import org.jetbrains.kotlin.resolve.calls.checkers.CallChecker
|
||||
import org.jetbrains.kotlin.resolve.calls.checkers.CallCheckerContext
|
||||
@@ -44,20 +46,11 @@ import org.jetbrains.kotlin.utils.addIfNotNull
|
||||
class ExperimentalUsageChecker(project: Project) : CallChecker {
|
||||
private val moduleAnnotationsResolver = ModuleAnnotationsResolver.getInstance(project)
|
||||
|
||||
internal data class Experimentality(
|
||||
val markerDescriptor: ClassDescriptor,
|
||||
val annotationFqName: FqName,
|
||||
val severity: Severity,
|
||||
val impact: List<Impact>
|
||||
) {
|
||||
val isCompilationOnly: Boolean get() = impact.all(Impact.COMPILATION::equals)
|
||||
|
||||
internal data class Experimentality(val annotationFqName: FqName, val severity: Severity) {
|
||||
enum class Severity { WARNING, ERROR }
|
||||
enum class Impact { COMPILATION, LINKAGE_OR_RUNTIME }
|
||||
|
||||
companion object {
|
||||
val DEFAULT_SEVERITY = Severity.ERROR
|
||||
val DEFAULT_IMPACT = listOf(Impact.COMPILATION, Impact.LINKAGE_OR_RUNTIME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,11 +67,6 @@ class ExperimentalUsageChecker(project: Project) : CallChecker {
|
||||
private val WARNING_LEVEL = Name.identifier("WARNING")
|
||||
private val ERROR_LEVEL = Name.identifier("ERROR")
|
||||
|
||||
internal val IMPACT = Name.identifier("changesMayBreak")
|
||||
private val COMPILATION_IMPACT = Name.identifier("COMPILATION")
|
||||
private val LINKAGE_IMPACT = Name.identifier("LINKAGE")
|
||||
private val RUNTIME_IMPACT = Name.identifier("RUNTIME")
|
||||
|
||||
private fun checkExperimental(
|
||||
descriptor: DeclarationDescriptor,
|
||||
element: PsiElement,
|
||||
@@ -88,14 +76,13 @@ class ExperimentalUsageChecker(project: Project) : CallChecker {
|
||||
val experimentalities = descriptor.loadExperimentalities(moduleAnnotationsResolver)
|
||||
if (experimentalities.isNotEmpty()) {
|
||||
checkExperimental(
|
||||
experimentalities, element, context.trace.bindingContext, context.languageVersionSettings,
|
||||
context.moduleDescriptor
|
||||
) { experimentality, isBodyUsageOfSourceOnlyExperimentality ->
|
||||
val diagnostic = when (experimentality.severity) {
|
||||
experimentalities, element, context.trace.bindingContext, context.languageVersionSettings
|
||||
) { (annotationFqName, severity) ->
|
||||
val diagnostic = when (severity) {
|
||||
Experimentality.Severity.WARNING -> Errors.EXPERIMENTAL_API_USAGE
|
||||
Experimentality.Severity.ERROR -> Errors.EXPERIMENTAL_API_USAGE_ERROR
|
||||
}
|
||||
context.trace.report(diagnostic.on(element, experimentality.annotationFqName, isBodyUsageOfSourceOnlyExperimentality))
|
||||
context.trace.report(diagnostic.on(element, annotationFqName))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,28 +92,19 @@ class ExperimentalUsageChecker(project: Project) : CallChecker {
|
||||
element: PsiElement,
|
||||
bindingContext: BindingContext,
|
||||
languageVersionSettings: LanguageVersionSettings,
|
||||
module: ModuleDescriptor,
|
||||
report: (experimentality: Experimentality, isBodyUsageOfCompilationExperimentality: Boolean) -> Unit
|
||||
report: (Experimentality) -> Unit
|
||||
) {
|
||||
val isBodyUsageExceptPublicInline = element.isBodyUsage(bindingContext, allowPublicInline = false)
|
||||
val isBodyUsage = isBodyUsageExceptPublicInline || element.isBodyUsage(bindingContext, allowPublicInline = true)
|
||||
|
||||
for (experimentality in experimentalities) {
|
||||
val isBodyUsageOfCompilationExperimentality =
|
||||
experimentality.isCompilationOnly && isBodyUsage
|
||||
|
||||
val isBodyUsageInSameModule =
|
||||
experimentality.markerDescriptor.module == module && isBodyUsageExceptPublicInline
|
||||
|
||||
val annotationFqName = experimentality.annotationFqName
|
||||
val isExperimentalityAccepted =
|
||||
isBodyUsageInSameModule ||
|
||||
(isBodyUsageOfCompilationExperimentality &&
|
||||
element.hasContainerAnnotatedWithUseExperimental(annotationFqName, bindingContext, languageVersionSettings)) ||
|
||||
element.propagates(annotationFqName, bindingContext, languageVersionSettings)
|
||||
element.hasContainerAnnotatedWithUseExperimental(
|
||||
annotationFqName, bindingContext, languageVersionSettings
|
||||
) || element.propagates(
|
||||
annotationFqName, bindingContext, languageVersionSettings
|
||||
)
|
||||
|
||||
if (!isExperimentalityAccepted) {
|
||||
report(experimentality, isBodyUsageOfCompilationExperimentality)
|
||||
report(experimentality)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -162,46 +140,7 @@ class ExperimentalUsageChecker(project: Project) : CallChecker {
|
||||
else -> Experimentality.DEFAULT_SEVERITY
|
||||
}
|
||||
|
||||
val impact = (experimental.allValueArguments[IMPACT] as? ArrayValue)?.value?.mapNotNull { impact ->
|
||||
when ((impact as? EnumValue)?.enumEntryName) {
|
||||
COMPILATION_IMPACT -> Experimentality.Impact.COMPILATION
|
||||
LINKAGE_IMPACT, RUNTIME_IMPACT -> Experimentality.Impact.LINKAGE_OR_RUNTIME
|
||||
else -> null
|
||||
}
|
||||
} ?: Experimentality.DEFAULT_IMPACT
|
||||
|
||||
return Experimentality(this, fqNameSafe, severity, impact)
|
||||
}
|
||||
|
||||
// Returns true if this element appears in the body of some function and is not visible in any non-local declaration signature.
|
||||
// If that's the case, one can opt-in to using the corresponding experimental API by annotating this element (or any of its
|
||||
// enclosing declarations) with @UseExperimental(X::class), not requiring propagation of the experimental annotation to the call sites.
|
||||
// (Note that this is allowed only if X's impact is [COMPILATION].)
|
||||
private fun PsiElement.isBodyUsage(bindingContext: BindingContext, allowPublicInline: Boolean): Boolean {
|
||||
return anyParentMatches { element, parent ->
|
||||
element == (parent as? KtDeclarationWithBody)?.bodyExpression?.takeIf {
|
||||
allowPublicInline || !parent.isPublicInline(bindingContext)
|
||||
} ||
|
||||
element == (parent as? KtDeclarationWithInitializer)?.initializer ||
|
||||
element == (parent as? KtClassInitializer)?.body ||
|
||||
element == (parent as? KtParameter)?.defaultValue ||
|
||||
element == (parent as? KtSuperTypeCallEntry)?.valueArgumentList ||
|
||||
element == (parent as? KtDelegatedSuperTypeEntry)?.delegateExpression ||
|
||||
element == (parent as? KtPropertyDelegate)?.expression
|
||||
}
|
||||
}
|
||||
|
||||
private fun PsiElement.isPublicInline(bindingContext: BindingContext): Boolean {
|
||||
val descriptor = when (this) {
|
||||
is KtFunction -> bindingContext.get(BindingContext.FUNCTION, this)
|
||||
is KtPropertyAccessor -> bindingContext.get(BindingContext.PROPERTY_ACCESSOR, this)
|
||||
else -> null
|
||||
}
|
||||
return descriptor != null && descriptor.isInline && descriptor.effectiveVisibility().let {
|
||||
it == EffectiveVisibility.Public ||
|
||||
it == EffectiveVisibility.ProtectedBound ||
|
||||
it is EffectiveVisibility.Protected
|
||||
}
|
||||
return Experimentality(fqNameSafe, severity)
|
||||
}
|
||||
|
||||
// Checks whether any of the non-local enclosing declarations is annotated with annotationFqName, effectively requiring
|
||||
@@ -263,18 +202,14 @@ class ExperimentalUsageChecker(project: Project) : CallChecker {
|
||||
// module annotations. For now, we only check deprecations because this is needed to correctly retire unneeded compiler arguments.
|
||||
val deprecationResolver = DeprecationResolver(LockBasedStorageManager(), languageVersionSettings)
|
||||
|
||||
fun checkAnnotation(fqName: String, allowNonCompilationImpact: Boolean): Boolean {
|
||||
fun checkAnnotation(fqName: String): Boolean {
|
||||
val descriptor = module.resolveClassByFqName(FqName(fqName), NoLookupLocation.FOR_NON_TRACKED_SCOPE)
|
||||
val experimentality = descriptor?.loadExperimentalityForMarkerAnnotation()
|
||||
val message = when {
|
||||
descriptor == null ->
|
||||
"Experimental API marker $fqName is unresolved. " +
|
||||
"Please make sure it's present in the module dependencies"
|
||||
"Experimental API marker $fqName is unresolved. Please make sure it's present in the module dependencies"
|
||||
experimentality == null ->
|
||||
"Class $fqName is not an experimental API marker annotation"
|
||||
!allowNonCompilationImpact && !experimentality.impact.all(Experimentality.Impact.COMPILATION::equals) ->
|
||||
"Experimental API marker $fqName has impact other than COMPILATION, " +
|
||||
"therefore it can't be used with -Xuse-experimental"
|
||||
else -> {
|
||||
for (deprecation in deprecationResolver.getDeprecations(descriptor)) {
|
||||
val report = when (deprecation.deprecationLevel) {
|
||||
@@ -292,12 +227,8 @@ class ExperimentalUsageChecker(project: Project) : CallChecker {
|
||||
return false
|
||||
}
|
||||
|
||||
val validExperimental =
|
||||
languageVersionSettings.getFlag(AnalysisFlag.experimental)
|
||||
.filter { checkAnnotation(it, allowNonCompilationImpact = true) }
|
||||
val validUseExperimental =
|
||||
languageVersionSettings.getFlag(AnalysisFlag.useExperimental)
|
||||
.filter { checkAnnotation(it, allowNonCompilationImpact = false) }
|
||||
val validExperimental = languageVersionSettings.getFlag(AnalysisFlag.experimental).filter(::checkAnnotation)
|
||||
val validUseExperimental = languageVersionSettings.getFlag(AnalysisFlag.useExperimental).filter(::checkAnnotation)
|
||||
|
||||
for (fqName in validExperimental.intersect(validUseExperimental)) {
|
||||
reportError("'-Xuse-experimental=$fqName' has no effect because '-Xexperimental=$fqName' is used")
|
||||
@@ -323,21 +254,18 @@ class ExperimentalUsageChecker(project: Project) : CallChecker {
|
||||
member.loadExperimentalities(moduleAnnotationsResolver).map { experimentality -> experimentality to member }
|
||||
}.toMap()
|
||||
|
||||
val module = descriptor.module
|
||||
|
||||
for ((experimentality, member) in experimentalOverridden) {
|
||||
checkExperimental(
|
||||
listOf(experimentality), declaration, context.trace.bindingContext, context.languageVersionSettings, module
|
||||
) { _, _ ->
|
||||
val diagnostic = when (experimentality.severity) {
|
||||
listOf(experimentality), declaration, context.trace.bindingContext, context.languageVersionSettings
|
||||
) { (annotationFqName, severity) ->
|
||||
val diagnostic = when (severity) {
|
||||
Experimentality.Severity.WARNING -> Errors.EXPERIMENTAL_OVERRIDE
|
||||
Experimentality.Severity.ERROR -> Errors.EXPERIMENTAL_OVERRIDE_ERROR
|
||||
}
|
||||
val reportOn = (declaration as? KtNamedDeclaration)?.nameIdentifier ?: declaration
|
||||
context.trace.report(diagnostic.on(reportOn, experimentality.annotationFqName, member.containingDeclaration))
|
||||
context.trace.report(diagnostic.on(reportOn, annotationFqName, member.containingDeclaration))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.test
|
||||
|
||||
@Experimental(Experimental.Level.ERROR, [Experimental.Impact.COMPILATION])
|
||||
@Experimental
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
+4
-4
@@ -4,7 +4,7 @@ $TEMP_DIR$
|
||||
-Xskip-runtime-version-check
|
||||
-language-version
|
||||
1.3
|
||||
-Xexperimental=org.test.BinaryError
|
||||
-Xexperimental=org.test.BinaryHidden
|
||||
-Xuse-experimental=org.test.SourceError
|
||||
-Xuse-experimental=org.test.SourceHidden
|
||||
-Xexperimental=org.test.Error1
|
||||
-Xexperimental=org.test.Hidden1
|
||||
-Xuse-experimental=org.test.Error2
|
||||
-Xuse-experimental=org.test.Hidden2
|
||||
|
||||
+12
-12
@@ -1,17 +1,17 @@
|
||||
package org.test
|
||||
|
||||
@Deprecated("BinaryError", level = DeprecationLevel.ERROR)
|
||||
@Experimental(Experimental.Level.ERROR, [Experimental.Impact.RUNTIME])
|
||||
annotation class BinaryError
|
||||
@Deprecated("Error1", level = DeprecationLevel.ERROR)
|
||||
@Experimental
|
||||
annotation class Error1
|
||||
|
||||
@Deprecated("BinaryHidden", level = DeprecationLevel.HIDDEN)
|
||||
@Experimental(Experimental.Level.ERROR, [Experimental.Impact.RUNTIME])
|
||||
annotation class BinaryHidden
|
||||
@Deprecated("Error2", level = DeprecationLevel.ERROR)
|
||||
@Experimental
|
||||
annotation class Error2
|
||||
|
||||
@Deprecated("SourceError", level = DeprecationLevel.ERROR)
|
||||
@Experimental(Experimental.Level.ERROR, [Experimental.Impact.COMPILATION])
|
||||
annotation class SourceError
|
||||
@Deprecated("Hidden1", level = DeprecationLevel.HIDDEN)
|
||||
@Experimental
|
||||
annotation class Hidden1
|
||||
|
||||
@Deprecated("SourceHidden", level = DeprecationLevel.HIDDEN)
|
||||
@Experimental(Experimental.Level.ERROR, [Experimental.Impact.COMPILATION])
|
||||
annotation class SourceHidden
|
||||
@Deprecated("Hidden2", level = DeprecationLevel.HIDDEN)
|
||||
@Experimental
|
||||
annotation class Hidden2
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
warning: language version 1.3 is experimental, there are no backwards compatibility guarantees for new language and library features
|
||||
error: experimental API marker org.test.BinaryError is deprecated. BinaryError
|
||||
error: experimental API marker org.test.BinaryHidden is deprecated. BinaryHidden
|
||||
error: experimental API marker org.test.SourceError is deprecated. SourceError
|
||||
error: experimental API marker org.test.SourceHidden is deprecated. SourceHidden
|
||||
error: experimental API marker org.test.Error1 is deprecated. Error1
|
||||
error: experimental API marker org.test.Hidden1 is deprecated. Hidden1
|
||||
error: experimental API marker org.test.Error2 is deprecated. Error2
|
||||
error: experimental API marker org.test.Hidden2 is deprecated. Hidden2
|
||||
COMPILATION_ERROR
|
||||
|
||||
@@ -4,5 +4,5 @@ $TEMP_DIR$
|
||||
-Xskip-runtime-version-check
|
||||
-language-version
|
||||
1.3
|
||||
-Xuse-experimental=org.test.SourceWarning
|
||||
-Xexperimental=org.test.BinaryWarning
|
||||
-Xuse-experimental=org.test.Warning1
|
||||
-Xexperimental=org.test.Warning2
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package org.test
|
||||
|
||||
@Deprecated("BinaryWarning", level = DeprecationLevel.WARNING)
|
||||
@Experimental(Experimental.Level.ERROR, [Experimental.Impact.RUNTIME])
|
||||
annotation class BinaryWarning
|
||||
@Deprecated("Warning1", level = DeprecationLevel.WARNING)
|
||||
@Experimental
|
||||
annotation class Warning1
|
||||
|
||||
@Deprecated("SourceWarning", level = DeprecationLevel.WARNING)
|
||||
@Experimental(Experimental.Level.ERROR, [Experimental.Impact.COMPILATION])
|
||||
annotation class SourceWarning
|
||||
@Deprecated("Warning2", level = DeprecationLevel.WARNING)
|
||||
@Experimental
|
||||
annotation class Warning2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
warning: language version 1.3 is experimental, there are no backwards compatibility guarantees for new language and library features
|
||||
warning: experimental API marker org.test.BinaryWarning is deprecated. BinaryWarning
|
||||
warning: experimental API marker org.test.SourceWarning is deprecated. SourceWarning
|
||||
warning: experimental API marker org.test.Warning2 is deprecated. Warning2
|
||||
warning: experimental API marker org.test.Warning1 is deprecated. Warning1
|
||||
OK
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package org.test
|
||||
|
||||
class Outer {
|
||||
@Experimental(Experimental.Level.ERROR, [Experimental.Impact.LINKAGE])
|
||||
@Experimental
|
||||
annotation class Nested
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
$TESTDATA_DIR$/experimentalRuntimeScope.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-Xskip-runtime-version-check
|
||||
-language-version
|
||||
1.3
|
||||
-Xexperimental=org.test.Experimental1
|
||||
-Xuse-experimental=org.test.Experimental2
|
||||
@@ -1,7 +0,0 @@
|
||||
package org.test
|
||||
|
||||
@Experimental(Experimental.Level.ERROR, [Experimental.Impact.LINKAGE])
|
||||
annotation class Experimental1
|
||||
|
||||
@Experimental(Experimental.Level.ERROR, [Experimental.Impact.RUNTIME])
|
||||
annotation class Experimental2
|
||||
@@ -1,3 +0,0 @@
|
||||
warning: language version 1.3 is experimental, there are no backwards compatibility guarantees for new language and library features
|
||||
error: experimental API marker org.test.Experimental2 has impact other than COMPILATION, therefore it can't be used with -Xuse-experimental
|
||||
COMPILATION_ERROR
|
||||
@@ -1,11 +1,10 @@
|
||||
// !API_VERSION: 1.3
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
@Target(AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.TYPEALIAS,
|
||||
AnnotationTarget.VALUE_PARAMETER)
|
||||
annotation class ExperimentalAPI
|
||||
@@ -15,7 +14,6 @@ annotation class ExperimentalAPI
|
||||
AnnotationTarget.VALUE_PARAMETER)
|
||||
annotation class EAnno
|
||||
|
||||
// MODULE: usage1(api)
|
||||
// FILE: usage-propagate.kt
|
||||
|
||||
package usage1
|
||||
@@ -61,7 +59,6 @@ val inProperty = @EAnno fun() {}
|
||||
val inPropertyAccessor: () -> Unit
|
||||
get() = @EAnno fun() {}
|
||||
|
||||
// MODULE: usage2(api)
|
||||
// FILE: usage-use.kt
|
||||
|
||||
package usage2
|
||||
@@ -69,28 +66,28 @@ package usage2
|
||||
import api.*
|
||||
|
||||
@UseExperimental(ExperimentalAPI::class)
|
||||
@<!EXPERIMENTAL_API_USAGE!>EAnno<!> fun function() {}
|
||||
@EAnno fun function() {}
|
||||
|
||||
@UseExperimental(ExperimentalAPI::class)
|
||||
fun parameter(@<!EXPERIMENTAL_API_USAGE!>EAnno<!> p: String) {}
|
||||
fun parameter(@EAnno p: String) {}
|
||||
|
||||
@UseExperimental(ExperimentalAPI::class)
|
||||
fun parameterType(p: @<!EXPERIMENTAL_API_USAGE!>EAnno<!> String) {}
|
||||
fun parameterType(p: @EAnno String) {}
|
||||
|
||||
@UseExperimental(ExperimentalAPI::class)
|
||||
fun returnType(): @<!EXPERIMENTAL_API_USAGE!>EAnno<!> Unit {}
|
||||
fun returnType(): @EAnno Unit {}
|
||||
|
||||
@UseExperimental(ExperimentalAPI::class)
|
||||
@<!EXPERIMENTAL_API_USAGE!>EAnno<!> val property = ""
|
||||
@EAnno val property = ""
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>@UseExperimental(ExperimentalAPI::class)<!>
|
||||
@<!EXPERIMENTAL_API_USAGE!>EAnno<!> typealias Typealias = Unit
|
||||
@EAnno typealias Typealias = Unit
|
||||
|
||||
@UseExperimental(ExperimentalAPI::class)
|
||||
@<!EXPERIMENTAL_API_USAGE!>EAnno<!> class Klass
|
||||
@EAnno class Klass
|
||||
|
||||
@UseExperimental(ExperimentalAPI::class)
|
||||
annotation class AnnotationArgument(val p: <!EXPERIMENTAL_API_USAGE!>EAnno<!>)
|
||||
annotation class AnnotationArgument(val p: EAnno)
|
||||
|
||||
fun insideBody() {
|
||||
@UseExperimental(ExperimentalAPI::class) @EAnno fun local() {}
|
||||
@@ -105,7 +102,6 @@ val inPropertyAccessor: () -> Unit
|
||||
@UseExperimental(ExperimentalAPI::class)
|
||||
get() = @EAnno fun() {}
|
||||
|
||||
// MODULE: usage3(api)
|
||||
// FILE: usage-none.kt
|
||||
|
||||
package usage3
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@@ -10,7 +9,7 @@ package api {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.TYPEALIAS, AnnotationTarget.VALUE_PARAMETER}) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.TYPEALIAS, AnnotationTarget.VALUE_PARAMETER}) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@@ -18,13 +17,6 @@ package api {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage1> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage1 {
|
||||
@api.ExperimentalAPI public val inProperty: () -> kotlin.Unit
|
||||
@api.ExperimentalAPI public val inPropertyAccessor: () -> kotlin.Unit
|
||||
@@ -53,13 +45,6 @@ package usage1 {
|
||||
@api.ExperimentalAPI @api.EAnno public typealias Typealias = kotlin.Unit
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage2> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage2 {
|
||||
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public val inProperty: () -> kotlin.Unit
|
||||
public val inPropertyAccessor: () -> kotlin.Unit
|
||||
@@ -88,13 +73,6 @@ package usage2 {
|
||||
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) @api.EAnno public typealias Typealias = kotlin.Unit
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage3> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage3 {
|
||||
public val inProperty: () -> kotlin.Unit
|
||||
public val inPropertyAccessor: () -> kotlin.Unit
|
||||
|
||||
-104
@@ -1,104 +0,0 @@
|
||||
// !DIAGNOSTICS: -NOTHING_TO_INLINE
|
||||
// !API_VERSION: 1.3
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
annotation class ExperimentalCompilationAPI
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.LINKAGE])
|
||||
annotation class ExperimentalLinkageAPI
|
||||
|
||||
@ExperimentalCompilationAPI
|
||||
fun compilation() {}
|
||||
|
||||
@ExperimentalLinkageAPI
|
||||
fun linkage() {}
|
||||
|
||||
// FILE: usage.kt
|
||||
|
||||
package usage
|
||||
|
||||
import api.*
|
||||
|
||||
fun use1() {
|
||||
compilation()
|
||||
linkage()
|
||||
}
|
||||
|
||||
val use2 = compilation()
|
||||
val use3 = linkage()
|
||||
|
||||
// FILE: inline-usage.kt
|
||||
|
||||
package usage
|
||||
|
||||
import api.*
|
||||
|
||||
inline fun inlineUse1() {
|
||||
<!EXPERIMENTAL_API_USAGE!>compilation<!>()
|
||||
<!EXPERIMENTAL_API_USAGE!>linkage<!>()
|
||||
}
|
||||
|
||||
inline var inlineUse2: Unit
|
||||
get() {
|
||||
<!EXPERIMENTAL_API_USAGE!>compilation<!>()
|
||||
<!EXPERIMENTAL_API_USAGE!>linkage<!>()
|
||||
}
|
||||
set(value) {
|
||||
<!EXPERIMENTAL_API_USAGE!>compilation<!>()
|
||||
<!EXPERIMENTAL_API_USAGE!>linkage<!>()
|
||||
}
|
||||
|
||||
var inlineUse3: Unit
|
||||
inline get() {
|
||||
<!EXPERIMENTAL_API_USAGE!>compilation<!>()
|
||||
<!EXPERIMENTAL_API_USAGE!>linkage<!>()
|
||||
}
|
||||
@ExperimentalCompilationAPI
|
||||
@ExperimentalLinkageAPI
|
||||
inline set(value) {
|
||||
compilation()
|
||||
linkage()
|
||||
}
|
||||
|
||||
@ExperimentalCompilationAPI
|
||||
@ExperimentalLinkageAPI
|
||||
inline fun inlineUse4() {
|
||||
compilation()
|
||||
linkage()
|
||||
}
|
||||
|
||||
// FILE: private-inline-usage.kt
|
||||
|
||||
package usage
|
||||
|
||||
import api.*
|
||||
|
||||
private inline fun privateInline1() {
|
||||
compilation()
|
||||
linkage()
|
||||
}
|
||||
|
||||
internal inline fun privateInline2() {
|
||||
compilation()
|
||||
linkage()
|
||||
}
|
||||
|
||||
private inline var privateInline3: Unit
|
||||
get() {
|
||||
compilation()
|
||||
linkage()
|
||||
}
|
||||
set(value) {
|
||||
compilation()
|
||||
linkage()
|
||||
}
|
||||
|
||||
internal class InternalClass {
|
||||
inline fun privateInline4() {
|
||||
compilation()
|
||||
linkage()
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,16 @@
|
||||
// !API_VERSION: 1.3
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
annotation class ExperimentalCompilationAPI
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
interface I
|
||||
|
||||
@ExperimentalCompilationAPI
|
||||
@ExperimentalAPI
|
||||
class Impl : I
|
||||
|
||||
// MODULE: usage(api)
|
||||
// FILE: usage.kt
|
||||
|
||||
package usage
|
||||
@@ -21,12 +19,12 @@ import api.*
|
||||
|
||||
open class Base(val i: I)
|
||||
|
||||
@UseExperimental(ExperimentalCompilationAPI::class)
|
||||
@UseExperimental(ExperimentalAPI::class)
|
||||
class Derived : Base(Impl())
|
||||
|
||||
@UseExperimental(ExperimentalCompilationAPI::class)
|
||||
@UseExperimental(ExperimentalAPI::class)
|
||||
class Delegated : I by Impl()
|
||||
|
||||
@UseExperimental(ExperimentalCompilationAPI::class)
|
||||
@UseExperimental(ExperimentalAPI::class)
|
||||
val delegatedProperty by Impl()
|
||||
operator fun I.getValue(x: Any?, y: Any?) = null
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) public final annotation class ExperimentalCompilationAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalCompilationAPI()
|
||||
@kotlin.Experimental(level = Level.WARNING) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
@@ -16,7 +15,7 @@ package api {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@api.ExperimentalCompilationAPI public final class Impl : api.I {
|
||||
@api.ExperimentalAPI public final class Impl : api.I {
|
||||
public constructor Impl()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@@ -24,15 +23,8 @@ package api {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage {
|
||||
@kotlin.UseExperimental(markerClass = {api.ExperimentalCompilationAPI::class}) public val delegatedProperty: kotlin.Nothing?
|
||||
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public val delegatedProperty: kotlin.Nothing?
|
||||
public operator fun api.I.getValue(/*0*/ x: kotlin.Any?, /*1*/ y: kotlin.Any?): kotlin.Nothing?
|
||||
|
||||
public open class Base {
|
||||
@@ -43,14 +35,14 @@ package usage {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.UseExperimental(markerClass = {api.ExperimentalCompilationAPI::class}) public final class Delegated : api.I {
|
||||
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public final class Delegated : api.I {
|
||||
public constructor Delegated()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.UseExperimental(markerClass = {api.ExperimentalCompilationAPI::class}) public final class Derived : usage.Base {
|
||||
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public final class Derived : usage.Base {
|
||||
public constructor Derived()
|
||||
public final override /*1*/ /*fake_override*/ val i: api.I
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
// !DIAGNOSTICS: -NOTHING_TO_INLINE
|
||||
// !USE_EXPERIMENTAL: kotlin.Experimental
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
annotation class API
|
||||
|
||||
@API
|
||||
fun f() {}
|
||||
|
||||
// FILE: usage.kt
|
||||
|
||||
package usage
|
||||
|
||||
import api.*
|
||||
|
||||
fun use1() {
|
||||
<!EXPERIMENTAL_API_USAGE!>f<!>()
|
||||
}
|
||||
|
||||
val use2 = <!EXPERIMENTAL_API_USAGE!>f<!>()
|
||||
|
||||
// FILE: inline-usage.kt
|
||||
|
||||
package usage
|
||||
|
||||
import api.*
|
||||
|
||||
inline fun inlineUse1() {
|
||||
<!EXPERIMENTAL_API_USAGE!>f<!>()
|
||||
}
|
||||
|
||||
inline var inlineUse2: Unit
|
||||
get() {
|
||||
<!EXPERIMENTAL_API_USAGE!>f<!>()
|
||||
}
|
||||
set(value) {
|
||||
<!EXPERIMENTAL_API_USAGE!>f<!>()
|
||||
}
|
||||
|
||||
var inlineUse3: Unit
|
||||
inline get() {
|
||||
<!EXPERIMENTAL_API_USAGE!>f<!>()
|
||||
}
|
||||
@API
|
||||
inline set(value) {
|
||||
f()
|
||||
}
|
||||
|
||||
@API
|
||||
inline fun inlineUse4() {
|
||||
f()
|
||||
}
|
||||
|
||||
// FILE: private-inline-usage.kt
|
||||
|
||||
package usage
|
||||
|
||||
import api.*
|
||||
|
||||
private inline fun privateInline1() {
|
||||
<!EXPERIMENTAL_API_USAGE!>f<!>()
|
||||
}
|
||||
|
||||
internal inline fun privateInline2() {
|
||||
<!EXPERIMENTAL_API_USAGE!>f<!>()
|
||||
}
|
||||
|
||||
private inline var privateInline3: Unit
|
||||
get() {
|
||||
<!EXPERIMENTAL_API_USAGE!>f<!>()
|
||||
}
|
||||
set(value) {
|
||||
<!EXPERIMENTAL_API_USAGE!>f<!>()
|
||||
}
|
||||
|
||||
internal class InternalClass {
|
||||
inline fun privateInline4() {
|
||||
<!EXPERIMENTAL_API_USAGE!>f<!>()
|
||||
}
|
||||
}
|
||||
+4
-13
@@ -1,18 +1,10 @@
|
||||
package
|
||||
|
||||
package api {
|
||||
@api.ExperimentalCompilationAPI public fun compilation(): kotlin.Unit
|
||||
@api.ExperimentalLinkageAPI public fun linkage(): kotlin.Unit
|
||||
@api.API public fun f(): kotlin.Unit
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) public final annotation class ExperimentalCompilationAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalCompilationAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.LINKAGE}, level = Level.WARNING) public final annotation class ExperimentalLinkageAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalLinkageAPI()
|
||||
@kotlin.Experimental(level = Level.WARNING) public final annotation class API : kotlin.Annotation {
|
||||
public constructor API()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
@@ -24,9 +16,8 @@ package usage {
|
||||
public var inlineUse3: kotlin.Unit
|
||||
private var privateInline3: kotlin.Unit
|
||||
public val use2: kotlin.Unit
|
||||
public val use3: kotlin.Unit
|
||||
public inline fun inlineUse1(): kotlin.Unit
|
||||
@api.ExperimentalCompilationAPI @api.ExperimentalLinkageAPI public inline fun inlineUse4(): kotlin.Unit
|
||||
@api.API public inline fun inlineUse4(): kotlin.Unit
|
||||
private inline fun privateInline1(): kotlin.Unit
|
||||
internal inline fun privateInline2(): kotlin.Unit
|
||||
public fun use1(): kotlin.Unit
|
||||
@@ -1,10 +1,9 @@
|
||||
// !API_VERSION: 1.3
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
@@ -19,7 +18,6 @@ class C {
|
||||
@ExperimentalAPI
|
||||
fun C.extension() {}
|
||||
|
||||
// MODULE: usage1(api)
|
||||
// FILE: usage-propagate.kt
|
||||
|
||||
package usage1
|
||||
@@ -47,7 +45,6 @@ class Use {
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: usage2(api)
|
||||
// FILE: usage-use.kt
|
||||
|
||||
package usage2
|
||||
@@ -66,7 +63,7 @@ fun useAll() {
|
||||
|
||||
@UseExperimental(ExperimentalAPI::class)
|
||||
class Use {
|
||||
fun useAll(c: <!EXPERIMENTAL_API_USAGE!>C<!>) {
|
||||
fun useAll(c: C) {
|
||||
c.function()
|
||||
c.property
|
||||
C.Nested()
|
||||
@@ -75,7 +72,6 @@ class Use {
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: usage3(api)
|
||||
// FILE: usage-none.kt
|
||||
|
||||
package usage3
|
||||
|
||||
+1
-23
@@ -1,4 +1,3 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@@ -27,7 +26,7 @@ package api {
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION}) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION}) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@@ -35,13 +34,6 @@ package api {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage1> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage1 {
|
||||
@api.ExperimentalAPI public fun useAll(): kotlin.Unit
|
||||
|
||||
@@ -54,13 +46,6 @@ package usage1 {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage2> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage2 {
|
||||
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public fun useAll(): kotlin.Unit
|
||||
|
||||
@@ -73,13 +58,6 @@ package usage2 {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage3> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage3 {
|
||||
public fun use(): kotlin.Unit
|
||||
}
|
||||
|
||||
Vendored
+1
-3
@@ -1,10 +1,9 @@
|
||||
// !API_VERSION: 1.3
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
@@ -23,7 +22,6 @@ class C {
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: usage(api)
|
||||
// FILE: usage.kt
|
||||
|
||||
package usage
|
||||
|
||||
Vendored
+1
-9
@@ -1,4 +1,3 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@@ -20,7 +19,7 @@ package api {
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY}) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY}) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@@ -28,13 +27,6 @@ package api {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage {
|
||||
public fun use(): kotlin.Unit
|
||||
}
|
||||
|
||||
Vendored
-76
@@ -1,76 +0,0 @@
|
||||
// !API_VERSION: 1.3
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
annotation class ExperimentalCompilationAPI
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.LINKAGE])
|
||||
annotation class ExperimentalLinkageAPI
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.RUNTIME])
|
||||
annotation class ExperimentalRuntimeAPI
|
||||
|
||||
@ExperimentalCompilationAPI
|
||||
fun compilation() {}
|
||||
|
||||
@ExperimentalLinkageAPI
|
||||
fun linkage() {}
|
||||
|
||||
@ExperimentalRuntimeAPI
|
||||
fun runtime() {}
|
||||
|
||||
// MODULE: usage1(api)
|
||||
// FILE: usage.kt
|
||||
|
||||
package usage1
|
||||
|
||||
import api.*
|
||||
|
||||
@UseExperimental(ExperimentalCompilationAPI::class)
|
||||
@ExperimentalLinkageAPI
|
||||
@ExperimentalRuntimeAPI
|
||||
fun use() {
|
||||
compilation()
|
||||
linkage()
|
||||
runtime()
|
||||
}
|
||||
|
||||
@ExperimentalLinkageAPI
|
||||
@ExperimentalRuntimeAPI
|
||||
fun useUse() {
|
||||
use()
|
||||
}
|
||||
|
||||
@ExperimentalCompilationAPI
|
||||
@ExperimentalLinkageAPI
|
||||
@ExperimentalRuntimeAPI
|
||||
fun recursiveUse() {
|
||||
compilation()
|
||||
linkage()
|
||||
runtime()
|
||||
recursiveUse()
|
||||
}
|
||||
|
||||
// MODULE: usage2(api,usage1)
|
||||
// FILE: usage-no-annotation.txt
|
||||
|
||||
package usage2
|
||||
|
||||
import api.*
|
||||
|
||||
fun use1() {
|
||||
usage1.<!EXPERIMENTAL_API_USAGE, EXPERIMENTAL_API_USAGE!>use<!>()
|
||||
}
|
||||
|
||||
@ExperimentalLinkageAPI
|
||||
fun use2() {
|
||||
usage1.<!EXPERIMENTAL_API_USAGE!>use<!>()
|
||||
}
|
||||
|
||||
@ExperimentalRuntimeAPI
|
||||
fun use3() {
|
||||
usage1.<!EXPERIMENTAL_API_USAGE!>use<!>()
|
||||
}
|
||||
Vendored
-58
@@ -1,58 +0,0 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@api.ExperimentalCompilationAPI public fun compilation(): kotlin.Unit
|
||||
@api.ExperimentalLinkageAPI public fun linkage(): kotlin.Unit
|
||||
@api.ExperimentalRuntimeAPI public fun runtime(): kotlin.Unit
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) public final annotation class ExperimentalCompilationAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalCompilationAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.LINKAGE}, level = Level.WARNING) public final annotation class ExperimentalLinkageAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalLinkageAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.RUNTIME}, level = Level.WARNING) public final annotation class ExperimentalRuntimeAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalRuntimeAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage1> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage1 {
|
||||
@api.ExperimentalCompilationAPI @api.ExperimentalLinkageAPI @api.ExperimentalRuntimeAPI public fun recursiveUse(): kotlin.Unit
|
||||
@kotlin.UseExperimental(markerClass = {api.ExperimentalCompilationAPI::class}) @api.ExperimentalLinkageAPI @api.ExperimentalRuntimeAPI public fun use(): kotlin.Unit
|
||||
@api.ExperimentalLinkageAPI @api.ExperimentalRuntimeAPI public fun useUse(): kotlin.Unit
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage2> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage1 {
|
||||
}
|
||||
|
||||
package usage2 {
|
||||
public fun use1(): kotlin.Unit
|
||||
@api.ExperimentalLinkageAPI public fun use2(): kotlin.Unit
|
||||
@api.ExperimentalRuntimeAPI public fun use3(): kotlin.Unit
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
// !API_VERSION: 1.3
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
@Target(AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION)
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
@@ -13,7 +12,6 @@ const val MEANING = 42
|
||||
|
||||
annotation class Anno(val value: Int)
|
||||
|
||||
// MODULE: usage1(api)
|
||||
// FILE: usage-propagate.kt
|
||||
|
||||
package usage1
|
||||
@@ -24,7 +22,6 @@ import api.*
|
||||
@Anno(MEANING)
|
||||
fun usage() {}
|
||||
|
||||
// MODULE: usage2(api)
|
||||
// FILE: usage-use.kt
|
||||
|
||||
@file:UseExperimental(ExperimentalAPI::class)
|
||||
@@ -32,10 +29,10 @@ package usage2
|
||||
|
||||
import api.*
|
||||
|
||||
// TODO: there should be no warning here
|
||||
@Anno(<!EXPERIMENTAL_API_USAGE!>MEANING<!>)
|
||||
fun usage() {}
|
||||
|
||||
// MODULE: usage3(api)
|
||||
// FILE: usage-none.kt
|
||||
|
||||
package usage3
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@@ -12,7 +11,7 @@ package api {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION}) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION}) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@@ -20,35 +19,14 @@ package api {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage1> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage1 {
|
||||
@api.ExperimentalAPI @api.Anno(value = 42) public fun usage(): kotlin.Unit
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage2> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage2 {
|
||||
@api.Anno(value = 42) public fun usage(): kotlin.Unit
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage3> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage3 {
|
||||
@api.Anno(value = 42) public fun usage(): kotlin.Unit
|
||||
}
|
||||
|
||||
+2
-6
@@ -1,10 +1,9 @@
|
||||
// !API_VERSION: 1.3
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
@@ -17,7 +16,6 @@ class C {
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: usage1(api)
|
||||
// FILE: usage-propagate.kt
|
||||
|
||||
package usage1
|
||||
@@ -32,7 +30,6 @@ fun use1() {
|
||||
@ExperimentalAPI
|
||||
fun use2(f: C.D.E.F) = f.hashCode()
|
||||
|
||||
// MODULE: usage2(api)
|
||||
// FILE: usage-use.kt
|
||||
|
||||
package usage2
|
||||
@@ -45,9 +42,8 @@ fun use1() {
|
||||
}
|
||||
|
||||
@UseExperimental(ExperimentalAPI::class)
|
||||
fun use2(f: <!EXPERIMENTAL_API_USAGE!>C<!>.<!EXPERIMENTAL_API_USAGE!>D<!>.<!EXPERIMENTAL_API_USAGE!>E<!>.<!EXPERIMENTAL_API_USAGE!>F<!>) = f.hashCode()
|
||||
fun use2(f: C.D.E.F) = f.hashCode()
|
||||
|
||||
// MODULE: usage3(api)
|
||||
// FILE: usage-none.kt
|
||||
|
||||
package usage3
|
||||
|
||||
+1
-23
@@ -1,4 +1,3 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@@ -31,7 +30,7 @@ package api {
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION}) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION}) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@@ -39,37 +38,16 @@ package api {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage1> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage1 {
|
||||
@api.ExperimentalAPI public fun use1(): kotlin.Unit
|
||||
@api.ExperimentalAPI public fun use2(/*0*/ f: api.C.D.E.F): kotlin.Int
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage2> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage2 {
|
||||
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public fun use1(): kotlin.Unit
|
||||
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public fun use2(/*0*/ f: api.C.D.E.F): kotlin.Int
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage3> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage3 {
|
||||
public fun use1(): kotlin.Unit
|
||||
public fun use2(/*0*/ f: api.C.D.E.F): kotlin.Int
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// !API_VERSION: 1.3
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.ERROR, [Experimental.Impact.COMPILATION])
|
||||
@Experimental
|
||||
annotation class E
|
||||
|
||||
open class Base {
|
||||
@@ -12,7 +11,6 @@ open class Base {
|
||||
open fun foo() {}
|
||||
}
|
||||
|
||||
// MODULE: usage(api)
|
||||
// FILE: usage.kt
|
||||
|
||||
package usage
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@@ -11,7 +10,7 @@ package api {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.ERROR) public final annotation class E : kotlin.Annotation {
|
||||
@kotlin.Experimental public final annotation class E : kotlin.Annotation {
|
||||
public constructor E()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@@ -19,13 +18,6 @@ package api {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage {
|
||||
public fun test(/*0*/ b: api.Base): kotlin.Unit
|
||||
|
||||
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
// !API_VERSION: 1.3
|
||||
|
||||
<!EXPERIMENTAL_ANNOTATION_WITH_NO_IMPACT!>@Experimental(Experimental.Level.WARNING, [])<!>
|
||||
annotation class ExperimentalAPI
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
package
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {}, level = Level.WARNING) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+4
-4
@@ -5,19 +5,19 @@ package api
|
||||
|
||||
import kotlin.annotation.AnnotationTarget.*
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.RUNTIME])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
@Target(CLASS, ANNOTATION_CLASS, TYPE_PARAMETER, PROPERTY, FIELD, LOCAL_VARIABLE, VALUE_PARAMETER, CONSTRUCTOR, FUNCTION,
|
||||
PROPERTY_GETTER, PROPERTY_SETTER, TYPE, TYPEALIAS)
|
||||
annotation class E1
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.RUNTIME])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
<!EXPERIMENTAL_ANNOTATION_WITH_WRONG_TARGET!>@Target(FILE)<!>
|
||||
annotation class E2
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.RUNTIME])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
<!EXPERIMENTAL_ANNOTATION_WITH_WRONG_TARGET!>@Target(EXPRESSION)<!>
|
||||
annotation class E3
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.RUNTIME])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
<!EXPERIMENTAL_ANNOTATION_WITH_WRONG_TARGET!>@Target(FILE, EXPRESSION)<!>
|
||||
annotation class E4
|
||||
|
||||
+4
-4
@@ -2,28 +2,28 @@ package
|
||||
|
||||
package api {
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.RUNTIME}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.PROPERTY, AnnotationTarget.FIELD, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.TYPE, AnnotationTarget.TYPEALIAS}) public final annotation class E1 : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.PROPERTY, AnnotationTarget.FIELD, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.TYPE, AnnotationTarget.TYPEALIAS}) public final annotation class E1 : kotlin.Annotation {
|
||||
public constructor E1()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.RUNTIME}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FILE}) public final annotation class E2 : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FILE}) public final annotation class E2 : kotlin.Annotation {
|
||||
public constructor E2()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.RUNTIME}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.EXPRESSION}) public final annotation class E3 : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.EXPRESSION}) public final annotation class E3 : kotlin.Annotation {
|
||||
public constructor E3()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.RUNTIME}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FILE, AnnotationTarget.EXPRESSION}) public final annotation class E4 : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FILE, AnnotationTarget.EXPRESSION}) public final annotation class E4 : kotlin.Annotation {
|
||||
public constructor E4()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
+2
-27
@@ -1,32 +1,7 @@
|
||||
// !API_VERSION: 1.3
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.RUNTIME])
|
||||
@Target(AnnotationTarget.PROPERTY)
|
||||
annotation class BinaryExperimental
|
||||
|
||||
@BinaryExperimental
|
||||
val x = ""
|
||||
|
||||
// MODULE: usage(api)
|
||||
// FILE: usage.kt
|
||||
|
||||
import api.*
|
||||
|
||||
<!USE_EXPERIMENTAL_WITHOUT_ARGUMENTS!>@UseExperimental<!>
|
||||
fun use1(): String {
|
||||
return <!EXPERIMENTAL_API_USAGE!>x<!>
|
||||
}
|
||||
|
||||
<!USE_EXPERIMENTAL_ARGUMENT_HAS_NON_COMPILATION_IMPACT!>@UseExperimental(BinaryExperimental::class)<!>
|
||||
fun use2(): String {
|
||||
return <!EXPERIMENTAL_API_USAGE!>x<!>
|
||||
}
|
||||
fun f1() {}
|
||||
|
||||
<!USE_EXPERIMENTAL_ARGUMENT_IS_NOT_MARKER!>@UseExperimental(UseExperimental::class)<!>
|
||||
fun use3(): String {
|
||||
return <!EXPERIMENTAL_API_USAGE!>x<!>
|
||||
}
|
||||
fun f2() {}
|
||||
|
||||
+2
-22
@@ -1,24 +1,4 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@api.BinaryExperimental public val x: kotlin.String = ""
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.RUNTIME}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.PROPERTY}) public final annotation class BinaryExperimental : kotlin.Annotation {
|
||||
public constructor BinaryExperimental()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage> --
|
||||
package
|
||||
|
||||
@kotlin.UseExperimental(markerClass = {}) public fun use1(): kotlin.String
|
||||
@kotlin.UseExperimental(markerClass = {api.BinaryExperimental::class}) public fun use2(): kotlin.String
|
||||
@kotlin.UseExperimental(markerClass = {kotlin.UseExperimental::class}) public fun use3(): kotlin.String
|
||||
|
||||
package api {
|
||||
}
|
||||
@kotlin.UseExperimental(markerClass = {}) public fun f1(): kotlin.Unit
|
||||
@kotlin.UseExperimental(markerClass = {kotlin.UseExperimental::class}) public fun f2(): kotlin.Unit
|
||||
|
||||
Vendored
-52
@@ -1,52 +0,0 @@
|
||||
// !DIAGNOSTICS: -NOTHING_TO_INLINE
|
||||
// !API_VERSION: 1.3
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
annotation class ExperimentalCompilationAPI
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.LINKAGE])
|
||||
annotation class ExperimentalLinkageAPI
|
||||
|
||||
@ExperimentalCompilationAPI
|
||||
fun compilation() {}
|
||||
|
||||
@ExperimentalLinkageAPI
|
||||
fun linkage() {}
|
||||
|
||||
// MODULE: usage(api)
|
||||
// FILE: usage.kt
|
||||
|
||||
package usage
|
||||
|
||||
import api.*
|
||||
|
||||
@ExperimentalCompilationAPI
|
||||
@ExperimentalLinkageAPI
|
||||
fun use() {
|
||||
compilation()
|
||||
linkage()
|
||||
}
|
||||
|
||||
fun indirectUseNoAnnotation() {
|
||||
<!EXPERIMENTAL_API_USAGE, EXPERIMENTAL_API_USAGE!>use<!>()
|
||||
}
|
||||
|
||||
@ExperimentalCompilationAPI
|
||||
fun indirectUseOptInCompilation() {
|
||||
<!EXPERIMENTAL_API_USAGE!>use<!>()
|
||||
}
|
||||
|
||||
@ExperimentalLinkageAPI
|
||||
fun indirectUseOptInLinkage() {
|
||||
<!EXPERIMENTAL_API_USAGE!>use<!>()
|
||||
}
|
||||
|
||||
@ExperimentalCompilationAPI
|
||||
@ExperimentalLinkageAPI
|
||||
fun indirectUseOptInBoth() {
|
||||
use()
|
||||
}
|
||||
Vendored
-36
@@ -1,36 +0,0 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@api.ExperimentalCompilationAPI public fun compilation(): kotlin.Unit
|
||||
@api.ExperimentalLinkageAPI public fun linkage(): kotlin.Unit
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) public final annotation class ExperimentalCompilationAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalCompilationAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.LINKAGE}, level = Level.WARNING) public final annotation class ExperimentalLinkageAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalLinkageAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage {
|
||||
public fun indirectUseNoAnnotation(): kotlin.Unit
|
||||
@api.ExperimentalCompilationAPI @api.ExperimentalLinkageAPI public fun indirectUseOptInBoth(): kotlin.Unit
|
||||
@api.ExperimentalCompilationAPI public fun indirectUseOptInCompilation(): kotlin.Unit
|
||||
@api.ExperimentalLinkageAPI public fun indirectUseOptInLinkage(): kotlin.Unit
|
||||
@api.ExperimentalCompilationAPI @api.ExperimentalLinkageAPI public fun use(): kotlin.Unit
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
// !API_VERSION: 1.3
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
annotation class E
|
||||
|
||||
open class Base {
|
||||
@@ -16,7 +15,6 @@ class DerivedInSameModule : Base() {
|
||||
override fun <!EXPERIMENTAL_OVERRIDE!>foo<!>() {}
|
||||
}
|
||||
|
||||
// MODULE: usage1(api)
|
||||
// FILE: usage-propagate.kt
|
||||
|
||||
package usage1
|
||||
@@ -35,7 +33,6 @@ class Derived2 : Base() {
|
||||
override fun foo() {}
|
||||
}
|
||||
|
||||
// MODULE: usage2(api)
|
||||
// FILE: usage-none.kt
|
||||
|
||||
package usage2
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@@ -19,7 +18,7 @@ package api {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) public final annotation class E : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.WARNING) public final annotation class E : kotlin.Annotation {
|
||||
public constructor E()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@@ -27,13 +26,6 @@ package api {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage1> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage1 {
|
||||
|
||||
public open class Derived : api.Base {
|
||||
@@ -61,13 +53,6 @@ package usage1 {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage2> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage2 {
|
||||
|
||||
public final class Derived : api.Base {
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
// !API_VERSION: 1.3
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
@ExperimentalAPI
|
||||
fun function(): String = ""
|
||||
|
||||
// MODULE: usage1(api)
|
||||
// FILE: usage-propagate.kts
|
||||
|
||||
import api.*
|
||||
@@ -24,7 +22,6 @@ fun use() {
|
||||
<!EXPERIMENTAL_API_USAGE!>function<!>()
|
||||
<!EXPERIMENTAL_API_USAGE!>use<!>()
|
||||
|
||||
// MODULE: usage2(api)
|
||||
// FILE: usage-use.kts
|
||||
|
||||
@file:UseExperimental(ExperimentalAPI::class)
|
||||
@@ -34,10 +31,9 @@ fun use() {
|
||||
function()
|
||||
}
|
||||
|
||||
<!EXPERIMENTAL_API_USAGE!>function<!>()
|
||||
function()
|
||||
use()
|
||||
|
||||
// MODULE: usage3(api)
|
||||
// FILE: usage-none.kts
|
||||
|
||||
import api.*
|
||||
|
||||
@@ -1,51 +1,3 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@api.ExperimentalAPI public fun function(): kotlin.String
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage1> --
|
||||
package
|
||||
|
||||
public final class Usage_propagate : kotlin.script.templates.standard.ScriptTemplateWithArgs {
|
||||
public constructor Usage_propagate(/*0*/ args: kotlin.Array<kotlin.String>)
|
||||
public final override /*1*/ /*fake_override*/ val args: kotlin.Array<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
@api.ExperimentalAPI public final fun use(): kotlin.Unit
|
||||
}
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage2> --
|
||||
package
|
||||
|
||||
public final class Usage_use : kotlin.script.templates.standard.ScriptTemplateWithArgs {
|
||||
public constructor Usage_use(/*0*/ args: kotlin.Array<kotlin.String>)
|
||||
public final override /*1*/ /*fake_override*/ val args: kotlin.Array<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public final fun use(): kotlin.Unit
|
||||
}
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage3> --
|
||||
package
|
||||
|
||||
public final class Usage_none : kotlin.script.templates.standard.ScriptTemplateWithArgs {
|
||||
@@ -57,5 +9,31 @@ public final class Usage_none : kotlin.script.templates.standard.ScriptTemplateW
|
||||
public final fun use(): kotlin.Unit
|
||||
}
|
||||
|
||||
package api {
|
||||
public final class Usage_propagate : kotlin.script.templates.standard.ScriptTemplateWithArgs {
|
||||
public constructor Usage_propagate(/*0*/ args: kotlin.Array<kotlin.String>)
|
||||
public final override /*1*/ /*fake_override*/ val args: kotlin.Array<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
@api.ExperimentalAPI public final fun use(): kotlin.Unit
|
||||
}
|
||||
|
||||
public final class Usage_use : kotlin.script.templates.standard.ScriptTemplateWithArgs {
|
||||
public constructor Usage_use(/*0*/ args: kotlin.Array<kotlin.String>)
|
||||
public final override /*1*/ /*fake_override*/ val args: kotlin.Array<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public final fun use(): kotlin.Unit
|
||||
}
|
||||
|
||||
package api {
|
||||
@api.ExperimentalAPI public fun function(): kotlin.String
|
||||
|
||||
@kotlin.Experimental(level = Level.WARNING) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
// !API_VERSION: 1.3
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
@Target(AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.TYPEALIAS,
|
||||
AnnotationTarget.VALUE_PARAMETER)
|
||||
annotation class ExperimentalAPI
|
||||
@@ -19,7 +18,6 @@ val property: String = ""
|
||||
@ExperimentalAPI
|
||||
typealias Typealias = String
|
||||
|
||||
// MODULE: usage1(api)
|
||||
// FILE: usage-propagate.kt
|
||||
|
||||
package usage1
|
||||
@@ -42,7 +40,6 @@ class Use {
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: usage2(api)
|
||||
// FILE: usage-use.kt
|
||||
|
||||
package usage2
|
||||
@@ -67,7 +64,6 @@ class Use {
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: usage3(api)
|
||||
// FILE: usage-none.kt
|
||||
|
||||
package usage3
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@api.ExperimentalAPI public val property: kotlin.String = ""
|
||||
@api.ExperimentalAPI public fun function(): kotlin.String
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.TYPEALIAS, AnnotationTarget.VALUE_PARAMETER}) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.TYPEALIAS, AnnotationTarget.VALUE_PARAMETER}) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@@ -14,13 +13,6 @@ package api {
|
||||
@api.ExperimentalAPI public typealias Typealias = kotlin.String
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage1> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage1 {
|
||||
@api.ExperimentalAPI public fun useAll(): kotlin.Unit
|
||||
|
||||
@@ -33,13 +25,6 @@ package usage1 {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage2> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage2 {
|
||||
public fun useAll(): kotlin.Unit
|
||||
|
||||
@@ -52,13 +37,6 @@ package usage2 {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage3> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage3 {
|
||||
public fun use(): kotlin.Unit
|
||||
}
|
||||
|
||||
+7
-9
@@ -1,27 +1,25 @@
|
||||
// !API_VERSION: 1.3
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
@Target(AnnotationTarget.FUNCTION)
|
||||
annotation class CompilationExperimentalAPI
|
||||
annotation class ExperimentalAPI1
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.RUNTIME])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
@Target(AnnotationTarget.FUNCTION)
|
||||
annotation class RuntimeExperimentalAPI
|
||||
annotation class ExperimentalAPI2
|
||||
|
||||
@CompilationExperimentalAPI
|
||||
@ExperimentalAPI1
|
||||
fun compilation() {}
|
||||
|
||||
@RuntimeExperimentalAPI
|
||||
@ExperimentalAPI2
|
||||
fun runtime() {}
|
||||
|
||||
// MODULE: usage(api)
|
||||
// FILE: usage.kt
|
||||
|
||||
@file:UseExperimental(CompilationExperimentalAPI::class)
|
||||
@file:UseExperimental(ExperimentalAPI1::class)
|
||||
package usage
|
||||
|
||||
import api.*
|
||||
|
||||
+6
-14
@@ -1,32 +1,24 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@api.CompilationExperimentalAPI public fun compilation(): kotlin.Unit
|
||||
@api.RuntimeExperimentalAPI public fun runtime(): kotlin.Unit
|
||||
@api.ExperimentalAPI1 public fun compilation(): kotlin.Unit
|
||||
@api.ExperimentalAPI2 public fun runtime(): kotlin.Unit
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FUNCTION}) public final annotation class CompilationExperimentalAPI : kotlin.Annotation {
|
||||
public constructor CompilationExperimentalAPI()
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FUNCTION}) public final annotation class ExperimentalAPI1 : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI1()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.RUNTIME}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FUNCTION}) public final annotation class RuntimeExperimentalAPI : kotlin.Annotation {
|
||||
public constructor RuntimeExperimentalAPI()
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FUNCTION}) public final annotation class ExperimentalAPI2 : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI2()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage {
|
||||
public fun use(): kotlin.Unit
|
||||
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
// !API_VERSION: 1.3
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
@ExperimentalAPI
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
annotation class VeryExperimentalAPI
|
||||
|
||||
@ExperimentalAPI
|
||||
@VeryExperimentalAPI
|
||||
fun f() {}
|
||||
|
||||
@ExperimentalAPI
|
||||
fun g() {}
|
||||
|
||||
// FILE: usage.kt
|
||||
|
||||
@file:UseExperimental(ExperimentalAPI::class, VeryExperimentalAPI::class)
|
||||
package usage
|
||||
|
||||
import api.*
|
||||
|
||||
fun usage() {
|
||||
f()
|
||||
g()
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package
|
||||
|
||||
package api {
|
||||
@api.ExperimentalAPI @api.VeryExperimentalAPI public fun f(): kotlin.Unit
|
||||
@api.ExperimentalAPI public fun g(): kotlin.Unit
|
||||
|
||||
@kotlin.Experimental(level = Level.WARNING) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@api.ExperimentalAPI @kotlin.Experimental(level = Level.WARNING) public final annotation class VeryExperimentalAPI : kotlin.Annotation {
|
||||
public constructor VeryExperimentalAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
package usage {
|
||||
public fun usage(): kotlin.Unit
|
||||
}
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.ERROR, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.ERROR)
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
@ExperimentalAPI
|
||||
|
||||
Vendored
+1
-1
@@ -4,7 +4,7 @@ package
|
||||
package api {
|
||||
@api.ExperimentalAPI public fun function(): kotlin.String
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.ERROR) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.ERROR) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
+1
-3
@@ -1,18 +1,16 @@
|
||||
// !API_VERSION: 1.3
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
annotation class E
|
||||
|
||||
@E
|
||||
open class Foo(val s: String = "")
|
||||
|
||||
// MODULE: usage(api)
|
||||
// FILE: usage.kt
|
||||
|
||||
import api.*
|
||||
|
||||
+15
-23
@@ -1,26 +1,3 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS}) public final annotation class E : kotlin.Annotation {
|
||||
public constructor E()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@api.E public open class Foo {
|
||||
public constructor Foo(/*0*/ s: kotlin.String = ...)
|
||||
public final val s: kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage> --
|
||||
package
|
||||
|
||||
@kotlin.UseExperimental(markerClass = {api.E::class}) public val property: kotlin.String
|
||||
@@ -44,4 +21,19 @@ public final class Constructor {
|
||||
}
|
||||
|
||||
package api {
|
||||
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS}) public final annotation class E : kotlin.Annotation {
|
||||
public constructor E()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@api.E public open class Foo {
|
||||
public constructor Foo(/*0*/ s: kotlin.String = ...)
|
||||
public final val s: kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+3
-5
@@ -1,18 +1,17 @@
|
||||
// !API_VERSION: 1.3
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
@Target(AnnotationTarget.FUNCTION)
|
||||
annotation class E1
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
@Target(AnnotationTarget.FUNCTION)
|
||||
annotation class E2
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.WARNING)
|
||||
@Target(AnnotationTarget.FUNCTION)
|
||||
annotation class E3
|
||||
|
||||
@@ -25,7 +24,6 @@ fun e2() {}
|
||||
@E3
|
||||
fun e3() {}
|
||||
|
||||
// MODULE: usage(api)
|
||||
// FILE: usage.kt
|
||||
|
||||
package usage
|
||||
|
||||
compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalWithSeveralAnnotations.txt
Vendored
+3
-11
@@ -1,4 +1,3 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@@ -6,21 +5,21 @@ package api {
|
||||
@api.E2 public fun e2(): kotlin.Unit
|
||||
@api.E3 public fun e3(): kotlin.Unit
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FUNCTION}) public final annotation class E1 : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FUNCTION}) public final annotation class E1 : kotlin.Annotation {
|
||||
public constructor E1()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FUNCTION}) public final annotation class E2 : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FUNCTION}) public final annotation class E2 : kotlin.Annotation {
|
||||
public constructor E2()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FUNCTION}) public final annotation class E3 : kotlin.Annotation {
|
||||
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FUNCTION}) public final annotation class E3 : kotlin.Annotation {
|
||||
public constructor E3()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@@ -28,13 +27,6 @@ package api {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage> --
|
||||
package
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
package usage {
|
||||
@kotlin.UseExperimental(markerClass = {api.E1::class, api.E2::class, api.E3::class}) public fun use1(): kotlin.Unit
|
||||
@kotlin.UseExperimental(markerClass = {api.E1::class, api.E3::class}) public fun use2(): kotlin.Unit
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
compiler/testData/experimental/jsExperimentalModule/usage.kt:5:15: error: this declaration is experimental and its usage must be marked with '@lib.ExperimentalAPI'
|
||||
compiler/testData/experimental/jsExperimentalModule/usage.kt:5:15: error: this declaration is experimental and its usage must be marked with '@lib.ExperimentalAPI' or '@UseExperimental(lib.ExperimentalAPI::class)'
|
||||
fun fail(foo: Foo) {
|
||||
^
|
||||
compiler/testData/experimental/jsExperimentalModule/usage.kt:6:5: error: this declaration is experimental and its usage must be marked with '@lib.ExperimentalAPI'
|
||||
compiler/testData/experimental/jsExperimentalModule/usage.kt:6:5: error: this declaration is experimental and its usage must be marked with '@lib.ExperimentalAPI' or '@UseExperimental(lib.ExperimentalAPI::class)'
|
||||
bar()
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
compiler/testData/experimental/jvmExperimentalModule/usage.kt:5:15: error: this declaration is experimental and its usage must be marked with '@lib.ExperimentalAPI'
|
||||
compiler/testData/experimental/jvmExperimentalModule/usage.kt:5:15: error: this declaration is experimental and its usage must be marked with '@lib.ExperimentalAPI' or '@UseExperimental(lib.ExperimentalAPI::class)'
|
||||
fun fail(foo: Foo) {
|
||||
^
|
||||
compiler/testData/experimental/jvmExperimentalModule/usage.kt:6:5: error: this declaration is experimental and its usage must be marked with '@lib.ExperimentalAPI'
|
||||
compiler/testData/experimental/jvmExperimentalModule/usage.kt:6:5: error: this declaration is experimental and its usage must be marked with '@lib.ExperimentalAPI' or '@UseExperimental(lib.ExperimentalAPI::class)'
|
||||
bar()
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
|
||||
+1
-1
@@ -8,5 +8,5 @@ class B {
|
||||
annotation class C
|
||||
}
|
||||
|
||||
@Experimental(Experimental.Level.ERROR, [Experimental.Impact.COMPILATION])
|
||||
@Experimental(Experimental.Level.ERROR)
|
||||
annotation class D
|
||||
|
||||
+10
-20
@@ -2077,16 +2077,16 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/annotation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("bodyUsageInSameModule.kt")
|
||||
public void testBodyUsageInSameModule() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/bodyUsageInSameModule.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("bodyUsages.kt")
|
||||
public void testBodyUsages() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/bodyUsages.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("bodyUsagesAndInline.kt")
|
||||
public void testBodyUsagesAndInline() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/bodyUsagesAndInline.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("classMembers.kt")
|
||||
public void testClassMembers() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/classMembers.kt");
|
||||
@@ -2097,11 +2097,6 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/classMembersOverlyExperimental.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compilationVsLinkageVsRuntime.kt")
|
||||
public void testCompilationVsLinkageVsRuntime() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/compilationVsLinkageVsRuntime.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constVal.kt")
|
||||
public void testConstVal() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/constVal.kt");
|
||||
@@ -2122,11 +2117,6 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("experimentalWithNoImpact.kt")
|
||||
public void testExperimentalWithNoImpact() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalWithNoImpact.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("incorrectTargetsForExperimentalAnnotation.kt")
|
||||
public void testIncorrectTargetsForExperimentalAnnotation() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/incorrectTargetsForExperimentalAnnotation.kt");
|
||||
@@ -2137,11 +2127,6 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/incorrectUseExperimental.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("indirectBodyUsageInAnotherModule.kt")
|
||||
public void testIndirectBodyUsageInAnotherModule() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/indirectBodyUsageInAnotherModule.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("override.kt")
|
||||
public void testOverride() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/override.kt");
|
||||
@@ -2172,6 +2157,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnFile.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("useExperimentalOnFileWithVeryExperimentalMarker.kt")
|
||||
public void testUseExperimentalOnFileWithVeryExperimentalMarker() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnFileWithVeryExperimentalMarker.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("useExperimentalOnWholeModule.kt")
|
||||
public void testUseExperimentalOnWholeModule() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnWholeModule.kt");
|
||||
|
||||
compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java
Generated
+10
-20
@@ -2077,16 +2077,16 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/annotation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("bodyUsageInSameModule.kt")
|
||||
public void testBodyUsageInSameModule() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/bodyUsageInSameModule.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("bodyUsages.kt")
|
||||
public void testBodyUsages() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/bodyUsages.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("bodyUsagesAndInline.kt")
|
||||
public void testBodyUsagesAndInline() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/bodyUsagesAndInline.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("classMembers.kt")
|
||||
public void testClassMembers() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/classMembers.kt");
|
||||
@@ -2097,11 +2097,6 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/classMembersOverlyExperimental.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compilationVsLinkageVsRuntime.kt")
|
||||
public void testCompilationVsLinkageVsRuntime() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/compilationVsLinkageVsRuntime.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constVal.kt")
|
||||
public void testConstVal() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/constVal.kt");
|
||||
@@ -2122,11 +2117,6 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("experimentalWithNoImpact.kt")
|
||||
public void testExperimentalWithNoImpact() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalWithNoImpact.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("incorrectTargetsForExperimentalAnnotation.kt")
|
||||
public void testIncorrectTargetsForExperimentalAnnotation() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/incorrectTargetsForExperimentalAnnotation.kt");
|
||||
@@ -2137,11 +2127,6 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/incorrectUseExperimental.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("indirectBodyUsageInAnotherModule.kt")
|
||||
public void testIndirectBodyUsageInAnotherModule() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/indirectBodyUsageInAnotherModule.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("override.kt")
|
||||
public void testOverride() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/override.kt");
|
||||
@@ -2172,6 +2157,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnFile.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("useExperimentalOnFileWithVeryExperimentalMarker.kt")
|
||||
public void testUseExperimentalOnFileWithVeryExperimentalMarker() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnFileWithVeryExperimentalMarker.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("useExperimentalOnWholeModule.kt")
|
||||
public void testUseExperimentalOnWholeModule() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnWholeModule.kt");
|
||||
|
||||
@@ -186,11 +186,6 @@ public class CliTestGenerated extends AbstractCliTest {
|
||||
runTest("compiler/testData/cli/jvm/experimentalNested.args");
|
||||
}
|
||||
|
||||
@TestMetadata("experimentalRuntimeScope.args")
|
||||
public void testExperimentalRuntimeScope() throws Exception {
|
||||
runTest("compiler/testData/cli/jvm/experimentalRuntimeScope.args");
|
||||
}
|
||||
|
||||
@TestMetadata("experimentalUnresolved.args")
|
||||
public void testExperimentalUnresolved() throws Exception {
|
||||
runTest("compiler/testData/cli/jvm/experimentalUnresolved.args");
|
||||
|
||||
@@ -12,17 +12,14 @@ import kotlin.reflect.KClass
|
||||
|
||||
/**
|
||||
* Signals that the annotated annotation class is a marker of an experimental API. Any declaration annotated with that marker is thus
|
||||
* considered an experimental declaration and its call sites must accept the experimental aspect of it either by using [UseExperimental],
|
||||
* considered an experimental declaration and its call sites should accept the experimental aspect of it either by using [UseExperimental],
|
||||
* or by being annotated with that marker themselves, effectively causing further propagation of that experimental aspect.
|
||||
*/
|
||||
@Target(ANNOTATION_CLASS)
|
||||
@Retention(BINARY)
|
||||
@SinceKotlin("1.3")
|
||||
@Suppress("ANNOTATION_CLASS_WITH_BODY", "ANNOTATION_CLASS_MEMBER", "ReplaceArrayOfWithLiteral")
|
||||
annotation class Experimental(
|
||||
val level: Level = Level.ERROR,
|
||||
val changesMayBreak: Array<Impact> = arrayOf(Impact.COMPILATION, Impact.LINKAGE, Impact.RUNTIME) // arrayOf, not [] because of KT-22578
|
||||
) {
|
||||
@Suppress("ANNOTATION_CLASS_MEMBER")
|
||||
annotation class Experimental(val level: Level = Level.ERROR) {
|
||||
/**
|
||||
* Severity of the diagnostic that should be reported on usages of experimental API which did not explicitly accept the experimental aspect
|
||||
* of that API either by using [UseExperimental] or by being annotated with the corresponding marker annotation.
|
||||
@@ -33,46 +30,11 @@ annotation class Experimental(
|
||||
/** Specifies that an error should be reported on incorrect usages of this experimental API. */
|
||||
ERROR,
|
||||
}
|
||||
|
||||
/**
|
||||
* Impact of the experimental API specifies what aspects may break after that API is changed.
|
||||
*/
|
||||
enum class Impact {
|
||||
/**
|
||||
* Signifies that changes in this experimental API can cause compilation errors or warnings in the client code.
|
||||
*
|
||||
* Non-signature usages (inside a function body, variable initializer, default argument value, etc.) of compilation-affecting
|
||||
* experimental API are allowed either if the containing declaration is annotated with the experimental annotation marker
|
||||
* and thus propagates the experimental aspect to its clients, or if there's a [UseExperimental] annotation entry with
|
||||
* the corresponding annotation marker somewhere above that usage in the parse tree. Signature usages of compilation-affecting
|
||||
* experimental API always require propagation (as long as the experimental API is declared in another module).
|
||||
*/
|
||||
COMPILATION,
|
||||
/**
|
||||
* Signifies that changes in this experimental API can cause linkage errors, i.e. exceptions at runtime
|
||||
* if the client code was not recompiled after the change.
|
||||
*
|
||||
* Any usage of a linkage-affecting experimental API requires its containing declaration to be annotated with
|
||||
* the corresponding annotation marker (except non-signature usages in annotation marker's module).
|
||||
*/
|
||||
LINKAGE,
|
||||
/**
|
||||
* Signifies that changes in this experimental API can cause changes in runtime behavior, including exceptions at runtime.
|
||||
*
|
||||
* Any usage of a runtime-affecting experimental API requires its containing declaration to be annotated with
|
||||
* the corresponding annotation marker (except non-signature usages in the annotation marker's module).
|
||||
*/
|
||||
RUNTIME,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to use experimental API denoted by the given markers in the annotated file, declaration, or expression. Each of the given markers
|
||||
* must be an annotation class, whose impact ([Experimental.changesMayBreak]) is [Experimental.Impact.COMPILATION].
|
||||
* Any other given annotation classes have no effect and are ignored.
|
||||
*
|
||||
* Only allows non-signature usages of the experimental API, i.e. inside a function body, variable initializer, default argument value, etc.
|
||||
* (Usages in declaration signatures must be propagated by annotating the affected signature with the marker annotation itself.)
|
||||
* Allows to use experimental API denoted by the given markers in the annotated file, declaration, or expression.
|
||||
* If a declaration is annotated with [UseExperimental], its usages are **not** required to opt-in to that experimental API.
|
||||
*/
|
||||
@Target(CLASS, PROPERTY, LOCAL_VARIABLE, VALUE_PARAMETER, CONSTRUCTOR, FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, EXPRESSION, FILE)
|
||||
@Retention(SOURCE)
|
||||
|
||||
-9
@@ -21,18 +21,9 @@ public final class kotlin/ExceptionsKt {
|
||||
}
|
||||
|
||||
public abstract interface annotation class kotlin/Experimental : java/lang/annotation/Annotation {
|
||||
public abstract fun changesMayBreak ()[Lkotlin/Experimental$Impact;
|
||||
public abstract fun level ()Lkotlin/Experimental$Level;
|
||||
}
|
||||
|
||||
public final class kotlin/Experimental$Impact : java/lang/Enum {
|
||||
public static final field COMPILATION Lkotlin/Experimental$Impact;
|
||||
public static final field LINKAGE Lkotlin/Experimental$Impact;
|
||||
public static final field RUNTIME Lkotlin/Experimental$Impact;
|
||||
public static fun valueOf (Ljava/lang/String;)Lkotlin/Experimental$Impact;
|
||||
public static fun values ()[Lkotlin/Experimental$Impact;
|
||||
}
|
||||
|
||||
public final class kotlin/Experimental$Level : java/lang/Enum {
|
||||
public static final field ERROR Lkotlin/Experimental$Level;
|
||||
public static final field WARNING Lkotlin/Experimental$Level;
|
||||
|
||||
Reference in New Issue
Block a user