@@ -2487,13 +2487,13 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
24872487 newMethod(owner, name, tpe, Flags .EmptyFlags , noSymbol)
24882488 def newMethod (owner : Symbol , name : String , tpe : TypeRepr , flags : Flags , privateWithin : Symbol ): Symbol =
24892489 checkValidFlags(flags.toTermFlags, Flags .validMethodFlags)
2490- dotc.core.Symbols .newSymbol(owner, name.toTermName, flags | dotc.core.Flags .Method , tpe, privateWithin)
2490+ dotc.core.Symbols .newSymbol(owner, name.toTermName, flags.toInternalFlags | dotc.core.Flags .Method , tpe, privateWithin)
24912491 def newVal (owner : Symbol , name : String , tpe : TypeRepr , flags : Flags , privateWithin : Symbol ): Symbol =
24922492 checkValidFlags(flags.toTermFlags, Flags .validValFlags)
2493- dotc.core.Symbols .newSymbol(owner, name.toTermName, flags, tpe, privateWithin)
2493+ dotc.core.Symbols .newSymbol(owner, name.toTermName, flags.toInternalFlags , tpe, privateWithin)
24942494 def newBind (owner : Symbol , name : String , flags : Flags , tpe : TypeRepr ): Symbol =
24952495 checkValidFlags(flags.toTermFlags, Flags .validBindFlags)
2496- dotc.core.Symbols .newSymbol(owner, name.toTermName, flags | dotc.core.Flags .Case , tpe)
2496+ dotc.core.Symbols .newSymbol(owner, name.toTermName, flags.toInternalFlags | dotc.core.Flags .Case , tpe)
24972497 def noSymbol : Symbol = dotc.core.Symbols .NoSymbol
24982498
24992499 private inline def checkValidFlags (inline flags : Flags , inline valid : Flags ): Unit =
@@ -2510,7 +2510,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
25102510 extension (self : Symbol )
25112511 def owner : Symbol = self.denot.owner
25122512 def maybeOwner : Symbol = self.denot.maybeOwner
2513- def flags : Flags = self.denot.flags
2513+ def flags : Flags = self.denot.flags.toExternalFlags
25142514
25152515 def privateWithin : Option [TypeRepr ] =
25162516 val within : Symbol =
@@ -2764,7 +2764,6 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
27642764
27652765 object Flags extends FlagsModule :
27662766 def Abstract : Flags = dotc.core.Flags .Abstract
2767- def AbsOverride : Flags = dotc.core.Flags .AbsOverride
27682767 def Artifact : Flags = dotc.core.Flags .Artifact
27692768 def Case : Flags = dotc.core.Flags .Case
27702769 def CaseAccessor : Flags = dotc.core.Flags .CaseAccessor
@@ -2811,8 +2810,8 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
28112810 def Trait : Flags = dotc.core.Flags .Trait
28122811 def Transparent : Flags = dotc.core.Flags .Transparent
28132812
2814- private [QuotesImpl ] def validMethodFlags : Flags = Private | Protected | Override | Deferred | Final | Method | Implicit | Given | Local | JavaStatic | AbsOverride // Synthetic | ExtensionMethod | Exported | Erased | Infix | Invisible
2815- private [QuotesImpl ] def validValFlags : Flags = Private | Protected | Override | Deferred | Final | Param | Implicit | Lazy | Mutable | Local | ParamAccessor | Module | Package | Case | CaseAccessor | Given | Enum | JavaStatic | AbsOverride // Synthetic | Erased | Invisible
2813+ private [QuotesImpl ] def validMethodFlags : Flags = Private | Protected | Override | Deferred | Final | Method | Implicit | Given | Local | JavaStatic // Synthetic | ExtensionMethod | Exported | Erased | Infix | Invisible
2814+ private [QuotesImpl ] def validValFlags : Flags = Private | Protected | Override | Deferred | Final | Param | Implicit | Lazy | Mutable | Local | ParamAccessor | Module | Package | Case | CaseAccessor | Given | Enum | JavaStatic // Synthetic | Erased | Invisible
28162815 private [QuotesImpl ] def validBindFlags : Flags = Case // | Implicit | Given | Erased
28172816 end Flags
28182817
@@ -2822,6 +2821,16 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
28222821 def | (that : Flags ): Flags = dotc.core.Flags .or(self, that) // TODO: Replace with dotc.core.Flags.|(self)(that) once extension names have stabilized
28232822 def & (that : Flags ): Flags = dotc.core.Flags .and(self, that)// TODO: Replace with dotc.core.Flags.&(self)(that) once extension names have stabilized
28242823 def show : String = Extractors .showFlags(using QuotesImpl .this )(self)
2824+
2825+ private [QuotesImpl ] inline def toInternalFlags : Flags =
2826+ if self.isAllOf(dotc.core.Flags .AbstractOverride ) then
2827+ self &~ dotc.core.Flags .AbstractOverride | dotc.core.Flags .AbsOverride
2828+ else self
2829+
2830+ private [QuotesImpl ] inline def toExternalFlags : Flags =
2831+ if self.is(dotc.core.Flags .AbsOverride ) then
2832+ self &~ dotc.core.Flags .AbsOverride | dotc.core.Flags .AbstractOverride
2833+ else self
28252834 end extension
28262835 end FlagsMethods
28272836
0 commit comments