From fc43000ac3bb51ac420460c6931805aa26c6df25 Mon Sep 17 00:00:00 2001 From: noti0na1 <8036790+noti0na1@users.noreply.github.com> Date: Thu, 25 Apr 2024 14:42:30 +0000 Subject: [PATCH 1/2] Make experimental final --- library/src-bootstrapped/scala/annotation/experimental.scala | 3 +-- .../src-non-bootstrapped/scala/annotation/experimental.scala | 3 +-- project/MiMaFilters.scala | 1 + tests/neg/experimentalExperimental.scala | 1 + tests/pos/experimentalExperimental.scala | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 tests/neg/experimentalExperimental.scala delete mode 100644 tests/pos/experimentalExperimental.scala 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..3dec32a4c369 100644 --- a/project/MiMaFilters.scala +++ b/project/MiMaFilters.scala @@ -56,6 +56,7 @@ 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"), + 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 From 38b87f977d77c45c49d3e0bae64d8ed12f715555 Mon Sep 17 00:00:00 2001 From: noti0na1 <8036790+noti0na1@users.noreply.github.com> Date: Thu, 25 Apr 2024 14:48:27 +0000 Subject: [PATCH 2/2] Add a comment for experimental in MiMaFilters --- project/MiMaFilters.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/project/MiMaFilters.scala b/project/MiMaFilters.scala index 3dec32a4c369..cc0da889620f 100644 --- a/project/MiMaFilters.scala +++ b/project/MiMaFilters.scala @@ -56,6 +56,7 @@ 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"), ),