From 9e29862f715e56492513ab4b46229cb1e7c52625 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Wed, 12 Feb 2025 16:45:58 +0100 Subject: [PATCH 1/2] chore: stabilise `@publicInBinary` --- library/src/scala/annotation/publicInBinary.scala | 1 - tests/run-tasty-inspector/stdlibExperimentalDefinitions.scala | 3 --- 2 files changed, 4 deletions(-) diff --git a/library/src/scala/annotation/publicInBinary.scala b/library/src/scala/annotation/publicInBinary.scala index 4990d266f892..a517f085dc7a 100644 --- a/library/src/scala/annotation/publicInBinary.scala +++ b/library/src/scala/annotation/publicInBinary.scala @@ -16,5 +16,4 @@ package scala.annotation * Adding this annotation to a non-public definition can also cause binary incompatibilities * if the definition is accessed in an inline definition (these can be checked using `-WunstableInlineAccessors`). */ -@experimental final class publicInBinary extends scala.annotation.StaticAnnotation diff --git a/tests/run-tasty-inspector/stdlibExperimentalDefinitions.scala b/tests/run-tasty-inspector/stdlibExperimentalDefinitions.scala index f01e0b0e1604..bda454c0be2b 100644 --- a/tests/run-tasty-inspector/stdlibExperimentalDefinitions.scala +++ b/tests/run-tasty-inspector/stdlibExperimentalDefinitions.scala @@ -39,9 +39,6 @@ val experimentalDefinitionInLibrary = Set( "scala.annotation.into", "scala.annotation.internal.$into", - //// New feature: @publicInBinary - "scala.annotation.publicInBinary", - //// New feature: Macro annotations "scala.annotation.MacroAnnotation", From 2bd5a4771dfed282fb60858e881156a351304bfb Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Fri, 21 Feb 2025 17:20:39 +0100 Subject: [PATCH 2/2] chore: drop experimental mode in SIP-52 tests --- tests/neg/i22498.check | 4 ++-- tests/neg/i22498.scala | 2 -- tests/neg/inline-unstable-accessors.scala | 2 +- tests/neg/publicInBinaryOverride.check | 10 +++++----- tests/neg/publicInBinaryOverride.scala | 2 -- tests/pos-macros/i15413/Macro_1.scala | 2 +- tests/pos-macros/i15413b/Macro_1.scala | 2 +- tests/pos-macros/i19526b/Test.scala | 2 -- tests/run/i13215.scala | 2 +- tests/run/i22497.scala | 2 -- tests/run/i22498.scala | 2 -- tests/run/noProtectedSuper.scala | 2 -- tests/run/publicInBinary/Lib_1.scala | 2 +- 13 files changed, 12 insertions(+), 24 deletions(-) diff --git a/tests/neg/i22498.check b/tests/neg/i22498.check index 39add35cbf1b..ed57392e975d 100644 --- a/tests/neg/i22498.check +++ b/tests/neg/i22498.check @@ -1,4 +1,4 @@ --- Error: tests/neg/i22498.scala:7:32 ---------------------------------------------------------------------------------- -7 | inline def proxy: Foo = new Foo(0) // error +-- Error: tests/neg/i22498.scala:5:32 ---------------------------------------------------------------------------------- +5 | inline def proxy: Foo = new Foo(0) // error | ^^^ | Private constructors used in inline methods require @publicInBinary diff --git a/tests/neg/i22498.scala b/tests/neg/i22498.scala index 43a8c8502308..54c59d2bb101 100644 --- a/tests/neg/i22498.scala +++ b/tests/neg/i22498.scala @@ -1,5 +1,3 @@ -//> using options -experimental - import scala.annotation.publicInBinary class Foo: diff --git a/tests/neg/inline-unstable-accessors.scala b/tests/neg/inline-unstable-accessors.scala index c02097f1921a..a7fa75c2c6c9 100644 --- a/tests/neg/inline-unstable-accessors.scala +++ b/tests/neg/inline-unstable-accessors.scala @@ -1,4 +1,4 @@ -//> using options -experimental -Werror -WunstableInlineAccessors -explain +//> using options -Werror -WunstableInlineAccessors -explain package foo import scala.annotation.publicInBinary diff --git a/tests/neg/publicInBinaryOverride.check b/tests/neg/publicInBinaryOverride.check index 73c60fa55d6a..e44692c78525 100644 --- a/tests/neg/publicInBinaryOverride.check +++ b/tests/neg/publicInBinaryOverride.check @@ -1,5 +1,5 @@ --- [E164] Declaration Error: tests/neg/publicInBinaryOverride.scala:10:15 ---------------------------------------------- -10 | override def f(): Unit = () // error - | ^ - | error overriding method f in class A of type (): Unit; - | method f of type (): Unit also needs to be declared with @publicInBinary +-- [E164] Declaration Error: tests/neg/publicInBinaryOverride.scala:8:15 ----------------------------------------------- +8 | override def f(): Unit = () // error + | ^ + | error overriding method f in class A of type (): Unit; + | method f of type (): Unit also needs to be declared with @publicInBinary diff --git a/tests/neg/publicInBinaryOverride.scala b/tests/neg/publicInBinaryOverride.scala index 6529bf09736a..4b9144d27540 100644 --- a/tests/neg/publicInBinaryOverride.scala +++ b/tests/neg/publicInBinaryOverride.scala @@ -1,5 +1,3 @@ -//> using options -experimental - import scala.annotation.publicInBinary class A: diff --git a/tests/pos-macros/i15413/Macro_1.scala b/tests/pos-macros/i15413/Macro_1.scala index f451742dff9e..56fd4f0f0887 100644 --- a/tests/pos-macros/i15413/Macro_1.scala +++ b/tests/pos-macros/i15413/Macro_1.scala @@ -1,4 +1,4 @@ -//> using options -experimental -Werror -WunstableInlineAccessors +//> using options -Werror -WunstableInlineAccessors import scala.quoted.* import scala.annotation.publicInBinary diff --git a/tests/pos-macros/i15413b/Macro_1.scala b/tests/pos-macros/i15413b/Macro_1.scala index df27b6267915..c1e9bab422f8 100644 --- a/tests/pos-macros/i15413b/Macro_1.scala +++ b/tests/pos-macros/i15413b/Macro_1.scala @@ -1,4 +1,4 @@ -//> using options -experimental -Werror -WunstableInlineAccessors +//> using options -Werror -WunstableInlineAccessors package bar diff --git a/tests/pos-macros/i19526b/Test.scala b/tests/pos-macros/i19526b/Test.scala index 96274091218f..1cc037298e01 100644 --- a/tests/pos-macros/i19526b/Test.scala +++ b/tests/pos-macros/i19526b/Test.scala @@ -1,5 +1,3 @@ -//> using options -experimental - package crash.test case class Stack private[crash] ( diff --git a/tests/run/i13215.scala b/tests/run/i13215.scala index f43e9aa1e38a..738eb25d598a 100644 --- a/tests/run/i13215.scala +++ b/tests/run/i13215.scala @@ -1,4 +1,4 @@ -//> using options -experimental -Werror -WunstableInlineAccessors +//> using options -Werror -WunstableInlineAccessors import scala.annotation.publicInBinary diff --git a/tests/run/i22497.scala b/tests/run/i22497.scala index a047a98e2b1e..723668db9750 100644 --- a/tests/run/i22497.scala +++ b/tests/run/i22497.scala @@ -3,11 +3,9 @@ import scala.annotation.publicInBinary import scala.annotation.experimental -@experimental class Foo: @publicInBinary private def this(i: Int) = this() @publicInBinary protected def this(i: String) = this() -@experimental @main def Test = println(classOf[Foo].getConstructors().mkString("\n")) diff --git a/tests/run/i22498.scala b/tests/run/i22498.scala index 2208978e5e0d..839a73ecff88 100644 --- a/tests/run/i22498.scala +++ b/tests/run/i22498.scala @@ -1,5 +1,3 @@ -//> using options -experimental - import scala.annotation.publicInBinary class Foo: diff --git a/tests/run/noProtectedSuper.scala b/tests/run/noProtectedSuper.scala index d05c13d90c9f..41b0615d12ab 100644 --- a/tests/run/noProtectedSuper.scala +++ b/tests/run/noProtectedSuper.scala @@ -1,5 +1,3 @@ -//> using options -experimental - import scala.annotation.publicInBinary package p { diff --git a/tests/run/publicInBinary/Lib_1.scala b/tests/run/publicInBinary/Lib_1.scala index e7b5a0780d1c..b6db126b7d82 100644 --- a/tests/run/publicInBinary/Lib_1.scala +++ b/tests/run/publicInBinary/Lib_1.scala @@ -1,4 +1,4 @@ -//> using options -experimental -Werror -WunstableInlineAccessors +//> using options -Werror -WunstableInlineAccessors package foo