Skip to content

Commit 4cb91b1

Browse files
pikinier20nicolasstucki
authored andcommitted
Add Symbol.isSuperAccessor to reflection API
1 parent 2ef89b2 commit 4cb91b1

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2515,6 +2515,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
25152515
def isAnonymousFunction: Boolean = self.denot.isAnonymousFunction
25162516
def isAbstractType: Boolean = self.denot.isAbstractType
25172517
def isClassConstructor: Boolean = self.denot.isClassConstructor
2518+
def isSuperAccessor = self.name.is(dotc.core.NameKinds.SuperAccessorName)
25182519
def isType: Boolean = self.isType
25192520
def isTerm: Boolean = self.isTerm
25202521
def isPackageDef: Boolean = self.is(dotc.core.Flags.Package)

library/src/scala/quoted/Quotes.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3651,6 +3651,10 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
36513651
/** Is this the constructor of a class? */
36523652
def isClassConstructor: Boolean
36533653

3654+
/** Is this the super accessor? */
3655+
@experimental // TODO when stable, remove `dotty.tools.scaladoc.tasty.ClassLikeSupport.isSuperBridgeMethod` and use this method
3656+
def isSuperAccessor: Boolean
3657+
36543658
/** Is this the definition of a type? */
36553659
def isType: Boolean
36563660

project/MiMaFilters.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ object MiMaFilters {
99
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.runtime.Tuples.append"),
1010
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TypeReprMethods.substituteTypes"),
1111
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TypeReprMethods.substituteTypes"),
12+
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#SymbolMethods.isSuperAccessor"),
13+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#SymbolMethods.isSuperAccessor"),
1214

1315
// Should have been added in 3.1.0
1416
// These are only allowed on imports and therefore should not be present in binaries emitted before

scaladoc/src/dotty/tools/scaladoc/tasty/SyntheticSupport.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ object SyntheticsSupport:
2121
import reflect._
2222
s.flags.is(Flags.Synthetic) || s.flags.is(Flags.FieldAccessor) || s.isDefaultHelperMethod
2323

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

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

0 commit comments

Comments
 (0)