Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate 3-arg FunctionClass constructor #18472

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions library/src/scala/quoted/Quotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4318,16 +4318,14 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
* - ...
* - Nth element is `FunctionN`
*/
// TODO: deprecate in 3.4 and stabilize FunctionClass(Int)/FunctionClass(Int,Boolean)
// @deprecated("Use overload of `FunctionClass` with 1 or 2 arguments","3.4")
@deprecated("Use overload of `FunctionClass` with 1 or 2 arguments","3.4")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@deprecated("Use overload of `FunctionClass` with 1 or 2 arguments","3.4")
@deprecated("Use overload of `FunctionClass` with 1 or 2 arguments", "3.4")

def FunctionClass(arity: Int, isImplicit: Boolean = false, isErased: Boolean = false): Symbol

/** Class symbol of a function class `scala.FunctionN`.
*
* @param arity the arity of the function where `0 <= arity`
* @return class symbol of `scala.FunctionN` where `N == arity`
*/
@experimental
def FunctionClass(arity: Int): Symbol

/** Class symbol of a context function class `scala.FunctionN` or `scala.ContextFunctionN`.
Expand All @@ -4336,7 +4334,6 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
* @param isContextual if it is a `scala.ContextFunctionN`
* @return class symbol of `scala.FunctionN` or `scala.ContextFunctionN` where `N == arity`
*/
@experimental
def FunctionClass(arity: Int, isContextual: Boolean): Symbol

/** The `scala.PolyFunction` built-in trait. */
Expand Down
1 change: 1 addition & 0 deletions project/MiMaFilters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ object MiMaFilters {
// New API in 3.4.X
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule.ValOrDefDefTypeTest"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule.ValOrDefDefMethods"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#defnModule.FunctionClass")
// New API in 3.4.X
)
val TastyCore: Seq[ProblemFilter] = Seq(
Expand Down
2 changes: 0 additions & 2 deletions tests/run-tasty-inspector/stdlibExperimentalDefinitions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ val experimentalDefinitionInLibrary = Set(
"scala.annotation.init$.region",

//// New APIs: Quotes
// Should be stabilized in 3.4.0
"scala.quoted.Quotes.reflectModule.defnModule.FunctionClass",
"scala.quoted.Quotes.reflectModule.FlagsModule.AbsOverride",
// Can be stabilized in 3.4.0 (unsure) or later
"scala.quoted.Quotes.reflectModule.CompilationInfoModule.XmacroSettings",
Expand Down