Skip to content

Commit

Permalink
Add explicit @experimental to inner experimental classes
Browse files Browse the repository at this point in the history
MiMa seems to check if the definition is experimental but it is missing
the check if the owner is experimental.
  • Loading branch information
nicolasstucki committed Jun 16, 2022
1 parent 004a2fd commit 90f600e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions library/src/scala/annotation/MainAnnotation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ object MainAnnotation:
* @param documentation The documentation of the main method without the `@param` documentation (see Parameter.documentaion)
* @param parameters Information about the parameters of the main method
*/
@experimental // MiMa does not check scope inherited @experimental
final class Info(
val name: String,
val documentation: String,
Expand All @@ -111,6 +112,7 @@ object MainAnnotation:
* @param documentation The documentation of the parameter (from `@param` documentation in the main method)
* @param annotations The annotations of the parameter that extend `ParameterAnnotation`
*/
@experimental // MiMa does not check scope inherited @experimental
final class Parameter(
val name: String,
val typeName: String,
Expand All @@ -121,6 +123,7 @@ object MainAnnotation:
)

/** Marker trait for annotations that will be included in the Parameter annotations. */
@experimental // MiMa does not check scope inherited @experimental
trait ParameterAnnotation extends StaticAnnotation

end MainAnnotation
3 changes: 2 additions & 1 deletion library/src/scala/annotation/newMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ final class newMain extends MainAnnotation[FromString, Any]:
hasParseErrors = true
() => throw new AssertionError("trying to get invalid argument")


@experimental // MiMa does not check scope inherited @experimental
private object Help:

/** The name of the special argument to display the method's help.
Expand Down Expand Up @@ -321,6 +321,7 @@ final class newMain extends MainAnnotation[FromString, Any]:

end Help

@experimental // MiMa does not check scope inherited @experimental
private class Names(info: Info):

checkNames()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@ val experimentalDefinitionInLibrary = Set(
// Should we have better support for main annotation macros?
"scala.annotation.MainAnnotation",
"scala.annotation.MainAnnotation$",
"scala.annotation.MainAnnotation$.Info",
"scala.annotation.MainAnnotation$.Parameter",
"scala.annotation.MainAnnotation$.ParameterAnnotation",


//// New feature: prototype of new version of @main
// This will never be stabilized. When it is ready it should replace the old @main annotation (requires scala.annotation.MainAnnotation).
// Needs user feedback.
"scala.annotation.newMain",
"scala.annotation.newMain$",
"scala.annotation.newMain$.alias",
"scala.annotation.newMain.Help",
"scala.annotation.newMain.Help$",
"scala.annotation.newMain.Names",

//// New APIs: Mirror
// Can be stabilized in 3.3.0 or later.
Expand Down

0 comments on commit 90f600e

Please sign in to comment.