Skip to content

Commit 25024c2

Browse files
committed
Add reflect Flags.AbsOverride
1 parent dcce753 commit 25024c2

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2484,13 +2484,11 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
24842484
newMethod(owner, name, tpe, Flags.EmptyFlags, noSymbol)
24852485
def newMethod(owner: Symbol, name: String, tpe: TypeRepr, flags: Flags, privateWithin: Symbol): Symbol =
24862486
import Flags.*
2487-
// TODO: missing AbsOverride
2488-
checkValidFlags(flags.toTermFlags, Private | Protected | Override | Deferred | Final | Method | Implicit | Given | Local) // Synthetic | ExtensionMethod | Exported | Erased | Infix | Invisible
2487+
checkValidFlags(flags.toTermFlags, Private | Protected | Override | Deferred | Final | Method | Implicit | Given | Local | AbsOverride) // Synthetic | ExtensionMethod | Exported | Erased | Infix | Invisible
24892488
dotc.core.Symbols.newSymbol(owner, name.toTermName, flags | dotc.core.Flags.Method, tpe, privateWithin)
24902489
def newVal(owner: Symbol, name: String, tpe: TypeRepr, flags: Flags, privateWithin: Symbol): Symbol =
24912490
import Flags.*
2492-
// TODO: missing AbsOverride
2493-
checkValidFlags(flags.toTermFlags, Private | Protected | Override | Deferred | Final | Param | Implicit | Lazy | Mutable | Local | ParamAccessor | Module | Package | Case | CaseAccessor | Given | Enum) // Synthetic | Erased | Invisible
2491+
checkValidFlags(flags.toTermFlags, Private | Protected | Override | Deferred | Final | Param | Implicit | Lazy | Mutable | Local | ParamAccessor | Module | Package | Case | CaseAccessor | Given | Enum | AbsOverride) // Synthetic | Erased | Invisible
24942492
dotc.core.Symbols.newSymbol(owner, name.toTermName, flags, tpe, privateWithin)
24952493
def newBind(owner: Symbol, name: String, flags: Flags, tpe: TypeRepr): Symbol =
24962494
import Flags.*
@@ -2770,6 +2768,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
27702768

27712769
object Flags extends FlagsModule:
27722770
def Abstract: Flags = dotc.core.Flags.Abstract
2771+
def AbsOverride: Flags = dotc.core.Flags.AbsOverride
27732772
def Artifact: Flags = dotc.core.Flags.Artifact
27742773
def Case: Flags = dotc.core.Flags.Case
27752774
def CaseAccessor: Flags = dotc.core.Flags.CaseAccessor

library/src/scala/quoted/Quotes.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4229,6 +4229,13 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
42294229
/** Is this symbol `abstract` */
42304230
def Abstract: Flags
42314231

4232+
/** Is this symbol is `abstract override`
4233+
*
4234+
* A trait that has only abstract methods as members
4235+
* and therefore can be represented by a Java interface.
4236+
*/
4237+
@experimental def AbsOverride: Flags
4238+
42324239
/** Is this generated by Scala compiler.
42334240
* Corresponds to ACC_SYNTHETIC in the JVM.
42344241
*/

tests/run-custom-args/tasty-inspector/stdlibExperimentalDefinitions.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ val experimentalDefinitionInLibrary = Set(
7676
"scala.quoted.Quotes.reflectModule.SymbolModule.newClass",
7777
"scala.quoted.Quotes.reflectModule.SymbolModule.freshName",
7878
"scala.quoted.Quotes.reflectModule.SymbolMethods.info",
79+
"scala.quoted.Quotes.reflectModule.FlagsModule.AbsOverride",
7980

8081
// New APIs: Lightweight lazy vals. Can be stabilized in 3.3.0
8182
"scala.runtime.LazyVals$.Evaluating",

0 commit comments

Comments
 (0)