Skip to content

Commit

Permalink
Stabilize reflect SymbolMethods.isSuperAccessor
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Apr 22, 2024
1 parent 2ca0ce7 commit 80a0cb5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion library/src/scala/quoted/Quotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4032,7 +4032,6 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
def isClassConstructor: Boolean

/** Is this the super accessor? */
@experimental // TODO when stable, remove `dotty.tools.scaladoc.tasty.ClassLikeSupport.isSuperBridgeMethod` and use this method
def isSuperAccessor: Boolean

/** Is this the definition of a type? */
Expand Down
5 changes: 4 additions & 1 deletion project/MiMaFilters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ object MiMaFilters {
// Only exceptional cases should be added here.

// Breaking changes since last reference version
Build.mimaPreviousDottyVersion -> Seq.empty, // We should never break backwards compatibility
Build.mimaPreviousDottyVersion -> // Seq.empty, // We should never break backwards compatibility
Seq(
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#SymbolMethods.isSuperAccessor"), // This change is acceptable. See comment in `Breaking changes since last LTS`.
),

// Breaking changes since last LTS
Build.mimaPreviousLTSDottyVersion -> Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ trait ClassLikeSupport:
extension (c: ClassDef)
def extractMembers: Seq[Member] = {
val inherited = c.getNonTrivialInheritedMemberTrees.collect {
case dd: DefDef if !dd.symbol.isClassConstructor && !(dd.symbol.isSuperBridgeMethod || dd.symbol.isDefaultHelperMethod) => dd
case dd: DefDef if !dd.symbol.isClassConstructor && !(dd.symbol.isSuperAccessor || dd.symbol.isDefaultHelperMethod) => dd
case other => other
}
c.membersToDocument.flatMap(parseMember(c)) ++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ object SyntheticsSupport:
import reflect._
s.flags.is(Flags.Synthetic) || s.flags.is(Flags.FieldAccessor) || s.isDefaultHelperMethod

// TODO remove and use `SymbolMethods.isSuperAccessor`
def isSuperBridgeMethod: Boolean = s.name.contains("$super$")

def isDefaultHelperMethod: Boolean = ".*\\$default\\$\\d+$".r.matches(s.name)

def isOpaque: Boolean =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ val experimentalDefinitionInLibrary = Set(
"scala.annotation.init$.widen",
"scala.annotation.init$.region",

//// New APIs: Quotes
// Can be stabilized in 3.5.0 or later
"scala.quoted.Quotes.reflectModule.SymbolMethods.isSuperAccessor",
//// New APIs: Quotes
// Can be stabilized in 3.5.0 (unsure) or later
"scala.quoted.Quotes.reflectModule.CompilationInfoModule.XmacroSettings",
// Cant be stabilized yet.
Expand Down

0 comments on commit 80a0cb5

Please sign in to comment.