diff --git a/library/src-bootstrapped/scala/annotation/experimental.scala b/library/src-bootstrapped/scala/annotation/experimental.scala index 185db51c07c1..634cfe12db7f 100644 --- a/library/src-bootstrapped/scala/annotation/experimental.scala +++ b/library/src-bootstrapped/scala/annotation/experimental.scala @@ -5,6 +5,5 @@ package scala.annotation * @see [[https://dotty.epfl.ch/docs/reference/other-new-features/experimental-defs]] * @syntax markdown */ -@deprecatedInheritance("Scheduled for being final in the future", "3.4.0") -class experimental(message: String) extends StaticAnnotation: +final class experimental(message: String) extends StaticAnnotation: def this() = this("") diff --git a/library/src-non-bootstrapped/scala/annotation/experimental.scala b/library/src-non-bootstrapped/scala/annotation/experimental.scala index dbc3296aa1ab..e879b47e12ff 100644 --- a/library/src-non-bootstrapped/scala/annotation/experimental.scala +++ b/library/src-non-bootstrapped/scala/annotation/experimental.scala @@ -1,4 +1,3 @@ package scala.annotation -@deprecatedInheritance("Scheduled for being final in the future", "3.4.0") -class experimental extends StaticAnnotation +final class experimental extends StaticAnnotation diff --git a/project/MiMaFilters.scala b/project/MiMaFilters.scala index 904367d15ecd..cc0da889620f 100644 --- a/project/MiMaFilters.scala +++ b/project/MiMaFilters.scala @@ -56,6 +56,8 @@ object MiMaFilters { ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#MethodTypeModule.apply"), ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#MethodTypeMethods.methodTypeKind"), ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#MethodTypeMethods.isContextual"), + // Change `experimental` annotation to a final class + ProblemFilters.exclude[FinalClassProblem]("scala.annotation.experimental"), ), // Breaking changes since last LTS diff --git a/tests/neg/experimentalExperimental.scala b/tests/neg/experimentalExperimental.scala new file mode 100644 index 000000000000..9011a3e49225 --- /dev/null +++ b/tests/neg/experimentalExperimental.scala @@ -0,0 +1 @@ +class MyExperimentalAnnot extends scala.annotation.experimental // error diff --git a/tests/pos/experimentalExperimental.scala b/tests/pos/experimentalExperimental.scala deleted file mode 100644 index 4b57e5b94346..000000000000 --- a/tests/pos/experimentalExperimental.scala +++ /dev/null @@ -1 +0,0 @@ -class MyExperimentalAnnot extends scala.annotation.experimental