[k1/K2]: Mark @SubclassOptInRequired as an experimental
At the moment, SubclassOptInRequired is marked with the ExperimentalSubclassOptIn annotation. However, it does not work as expected due to a missing opt-in error. To use SubclassOptInRequired, an explicit opt-in is necessary because SubclassOptInRequired is an unstable feature now. ^KT-64739
This commit is contained in:
committed by
Space Team
parent
882dc18e0e
commit
ad9025afa6
+6
@@ -42229,6 +42229,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/CorrectApplicability.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/CorrectApplicability.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("Experimentality.kt")
|
||||||
|
public void testExperimentality() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/Experimentality.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("IncorrectApplicability.kt")
|
@TestMetadata("IncorrectApplicability.kt")
|
||||||
public void testIncorrectApplicability() throws Exception {
|
public void testIncorrectApplicability() throws Exception {
|
||||||
|
|||||||
+6
@@ -42229,6 +42229,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/CorrectApplicability.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/CorrectApplicability.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("Experimentality.kt")
|
||||||
|
public void testExperimentality() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/Experimentality.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("IncorrectApplicability.kt")
|
@TestMetadata("IncorrectApplicability.kt")
|
||||||
public void testIncorrectApplicability() throws Exception {
|
public void testIncorrectApplicability() throws Exception {
|
||||||
|
|||||||
@@ -601,7 +601,7 @@ public abstract class Enum<E : R|kotlin/Enum<E>|> : R|kotlin/Comparable<E>|, R|j
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@R|kotlin/annotation/Target|(allowedTargets = <implicitArrayOf>(R|kotlin/annotation/AnnotationTarget.CLASS|)) @R|kotlin/annotation/Retention|(value = R|kotlin/annotation/AnnotationRetention.BINARY|) @R|kotlin/SinceKotlin|(version = String(1.8)) public final annotation class ExperimentalSubclassOptIn : R|kotlin/Annotation| {
|
@R|kotlin/annotation/Target|(allowedTargets = <implicitArrayOf>(R|kotlin/annotation/AnnotationTarget.CLASS|)) @R|kotlin/annotation/Retention|(value = R|kotlin/annotation/AnnotationRetention.BINARY|) @R|kotlin/SinceKotlin|(version = String(1.8)) @R|kotlin/RequiresOptIn|() public final annotation class ExperimentalSubclassOptIn : R|kotlin/Annotation| {
|
||||||
public constructor(): R|kotlin/ExperimentalSubclassOptIn|
|
public constructor(): R|kotlin/ExperimentalSubclassOptIn|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
FILE: ClassIdDiagnosticRendering.kt
|
FILE: ClassIdDiagnosticRendering.kt
|
||||||
|
@FILE:R|kotlin/OptIn|(markerClass = vararg(<getClass>(Q|kotlin/ExperimentalSubclassOptIn|)))
|
||||||
package a.b.c
|
package a.b.c
|
||||||
|
|
||||||
@R|kotlin/RequiresOptIn|() public final annotation class Marker : R|kotlin/Annotation| {
|
@R|kotlin/RequiresOptIn|() public final annotation class Marker : R|kotlin/Annotation| {
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// WITH_EXTENDED_CHECKERS
|
// WITH_EXTENDED_CHECKERS
|
||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
package a.b.c
|
package a.b.c
|
||||||
|
|
||||||
|
|||||||
+6
@@ -39943,6 +39943,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/CorrectApplicability.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/CorrectApplicability.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("Experimentality.kt")
|
||||||
|
public void testExperimentality() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/Experimentality.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("IncorrectApplicability.kt")
|
@TestMetadata("IncorrectApplicability.kt")
|
||||||
public void testIncorrectApplicability() throws Exception {
|
public void testIncorrectApplicability() throws Exception {
|
||||||
|
|||||||
+6
@@ -40063,6 +40063,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/CorrectApplicability.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/CorrectApplicability.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("Experimentality.kt")
|
||||||
|
public void testExperimentality() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/Experimentality.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("IncorrectApplicability.kt")
|
@TestMetadata("IncorrectApplicability.kt")
|
||||||
public void testIncorrectApplicability() throws Exception {
|
public void testIncorrectApplicability() throws Exception {
|
||||||
|
|||||||
+1
-1
@@ -347,7 +347,7 @@ public abstract class Enum</*0*/ E : kotlin.Enum<E>> : kotlin.Comparable<E> {
|
|||||||
/*primary*/ public constructor ExperimentalStdlibApi()
|
/*primary*/ public constructor ExperimentalStdlibApi()
|
||||||
}
|
}
|
||||||
|
|
||||||
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS}) @kotlin.annotation.Retention(value = AnnotationRetention.BINARY) @kotlin.SinceKotlin(version = "1.8") public final annotation class ExperimentalSubclassOptIn : kotlin.Annotation {
|
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS}) @kotlin.annotation.Retention(value = AnnotationRetention.BINARY) @kotlin.SinceKotlin(version = "1.8") @kotlin.RequiresOptIn public final annotation class ExperimentalSubclassOptIn : kotlin.Annotation {
|
||||||
/*primary*/ public constructor ExperimentalSubclassOptIn()
|
/*primary*/ public constructor ExperimentalSubclassOptIn()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -362,7 +362,7 @@ public abstract class Enum</*0*/ E : kotlin.Enum<E>> : kotlin.Comparable<E>, jav
|
|||||||
/*primary*/ public constructor ExperimentalStdlibApi()
|
/*primary*/ public constructor ExperimentalStdlibApi()
|
||||||
}
|
}
|
||||||
|
|
||||||
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS}) @kotlin.annotation.Retention(value = AnnotationRetention.BINARY) @kotlin.SinceKotlin(version = "1.8") public final annotation class ExperimentalSubclassOptIn : kotlin.Annotation {
|
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS}) @kotlin.annotation.Retention(value = AnnotationRetention.BINARY) @kotlin.SinceKotlin(version = "1.8") @kotlin.RequiresOptIn public final annotation class ExperimentalSubclassOptIn : kotlin.Annotation {
|
||||||
/*primary*/ public constructor ExperimentalSubclassOptIn()
|
/*primary*/ public constructor ExperimentalSubclassOptIn()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -364,7 +364,7 @@ public abstract class Enum</*0*/ E : kotlin.Enum<E>> : kotlin.Comparable<E>, jav
|
|||||||
/*primary*/ public constructor ExperimentalStdlibApi()
|
/*primary*/ public constructor ExperimentalStdlibApi()
|
||||||
}
|
}
|
||||||
|
|
||||||
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS}) @kotlin.annotation.Retention(value = AnnotationRetention.BINARY) @kotlin.SinceKotlin(version = "1.8") public final annotation class ExperimentalSubclassOptIn : kotlin.Annotation {
|
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS}) @kotlin.annotation.Retention(value = AnnotationRetention.BINARY) @kotlin.SinceKotlin(version = "1.8") @kotlin.RequiresOptIn public final annotation class ExperimentalSubclassOptIn : kotlin.Annotation {
|
||||||
/*primary*/ public constructor ExperimentalSubclassOptIn()
|
/*primary*/ public constructor ExperimentalSubclassOptIn()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -362,7 +362,7 @@ public abstract class Enum</*0*/ E : kotlin.Enum<E>> : kotlin.Comparable<E>, jav
|
|||||||
/*primary*/ public constructor ExperimentalStdlibApi()
|
/*primary*/ public constructor ExperimentalStdlibApi()
|
||||||
}
|
}
|
||||||
|
|
||||||
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS}) @kotlin.annotation.Retention(value = AnnotationRetention.BINARY) @kotlin.SinceKotlin(version = "1.8") public final annotation class ExperimentalSubclassOptIn : kotlin.Annotation {
|
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS}) @kotlin.annotation.Retention(value = AnnotationRetention.BINARY) @kotlin.SinceKotlin(version = "1.8") @kotlin.RequiresOptIn public final annotation class ExperimentalSubclassOptIn : kotlin.Annotation {
|
||||||
/*primary*/ public constructor ExperimentalSubclassOptIn()
|
/*primary*/ public constructor ExperimentalSubclassOptIn()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
annotation class ApiMarker
|
annotation class ApiMarker
|
||||||
|
|||||||
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
|
||||||
|
@RequiresOptIn
|
||||||
|
annotation class ApiMarker
|
||||||
|
|
||||||
|
@<!OPT_IN_USAGE_ERROR!>SubclassOptInRequired<!>(ApiMarker::class)
|
||||||
|
open class OpenKlass
|
||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
annotation class ApiMarker
|
annotation class ApiMarker
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
annotation class ApiMarker
|
annotation class ApiMarker
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
annotation class ApiMarker
|
annotation class ApiMarker
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
annotation class Api
|
annotation class Api
|
||||||
|
|||||||
Vendored
+1
@@ -1,4 +1,5 @@
|
|||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
annotation class Boom
|
annotation class Boom
|
||||||
|
|||||||
Vendored
+1
@@ -1,4 +1,5 @@
|
|||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
annotation class Boom
|
annotation class Boom
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
annotation class DummyAnnotation
|
annotation class DummyAnnotation
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
annotation class ApiMarker
|
annotation class ApiMarker
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
annotation class ApiMarker
|
annotation class ApiMarker
|
||||||
|
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
annotation class ApiMarker
|
annotation class ApiMarker
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
annotation class ApiMarker
|
annotation class ApiMarker
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
annotation class ApiMarker
|
annotation class ApiMarker
|
||||||
|
|||||||
Vendored
+1
@@ -1,4 +1,5 @@
|
|||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
annotation class ApiMarker
|
annotation class ApiMarker
|
||||||
|
|||||||
Vendored
+1
@@ -1,4 +1,5 @@
|
|||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
annotation class ApiMarker
|
annotation class ApiMarker
|
||||||
|
|||||||
Generated
+6
@@ -42229,6 +42229,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/CorrectApplicability.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/CorrectApplicability.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("Experimentality.kt")
|
||||||
|
public void testExperimentality() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/Experimentality.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("IncorrectApplicability.kt")
|
@TestMetadata("IncorrectApplicability.kt")
|
||||||
public void testIncorrectApplicability() throws Exception {
|
public void testIncorrectApplicability() throws Exception {
|
||||||
|
|||||||
@@ -1599,6 +1599,7 @@ public final annotation class ExperimentalStdlibApi : kotlin.Annotation {
|
|||||||
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS})
|
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS})
|
||||||
@kotlin.annotation.Retention(value = AnnotationRetention.BINARY)
|
@kotlin.annotation.Retention(value = AnnotationRetention.BINARY)
|
||||||
@kotlin.SinceKotlin(version = "1.8")
|
@kotlin.SinceKotlin(version = "1.8")
|
||||||
|
@kotlin.RequiresOptIn
|
||||||
public final annotation class ExperimentalSubclassOptIn : kotlin.Annotation {
|
public final annotation class ExperimentalSubclassOptIn : kotlin.Annotation {
|
||||||
public constructor ExperimentalSubclassOptIn()
|
public constructor ExperimentalSubclassOptIn()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ public annotation class OptIn(
|
|||||||
@Target(CLASS)
|
@Target(CLASS)
|
||||||
@Retention(BINARY)
|
@Retention(BINARY)
|
||||||
@SinceKotlin("1.8")
|
@SinceKotlin("1.8")
|
||||||
|
@RequiresOptIn
|
||||||
public annotation class ExperimentalSubclassOptIn
|
public annotation class ExperimentalSubclassOptIn
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user