Skip to content

Commit b9b80b6

Browse files
committed
Add reflect Flags.AbsOverride
1 parent a356581 commit b9b80b6

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-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
@@ -2783,6 +2783,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
27832783

27842784
object Flags extends FlagsModule:
27852785
def Abstract: Flags = dotc.core.Flags.Abstract
2786+
def AbsOverride: Flags = dotc.core.Flags.AbsOverride
27862787
def Artifact: Flags = dotc.core.Flags.Artifact
27872788
def Case: Flags = dotc.core.Flags.Case
27882789
def CaseAccessor: Flags = dotc.core.Flags.CaseAccessor

library/src/scala/quoted/Quotes.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4312,6 +4312,18 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
43124312
/** Is this symbol `abstract` */
43134313
def Abstract: Flags
43144314

4315+
/** Is this symbol is labeled with of abstract & override
4316+
*
4317+
* The override modifier has an additional significance when combined with the abstract modifier.
4318+
* That modifier combination is only allowed for value members of traits.
4319+
*
4320+
* We call a member MM of a template incomplete if it is either abstract (i.e. defined by a declaration), or it is labeled abstract and override and every member overridden by MM is again incomplete.
4321+
*
4322+
* Note that the abstract override modifier combination does not influence the concept whether a member is concrete or abstract.
4323+
* A member is abstract if only a declaration is given for it; it is concrete if a full definition is given.
4324+
*/
4325+
@experimental def AbsOverride: Flags
4326+
43154327
/** Is this generated by Scala compiler.
43164328
* Corresponds to ACC_SYNTHETIC in the JVM.
43174329
*/

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ val experimentalDefinitionInLibrary = Set(
6666
"scala.annotation.MacroAnnotation",
6767

6868
//// New APIs: Quotes
69+
// Can be stabilized in 3.4.0
70+
"scala.quoted.Quotes.reflectModule.FlagsModule.AbsOverride",
6971
// Can be stabilized in 3.3.0 (unsure) or later
7072
"scala.quoted.Quotes.reflectModule.CompilationInfoModule.XmacroSettings",
7173
"scala.quoted.Quotes.reflectModule.FlagsModule.JavaAnnotation",

0 commit comments

Comments
 (0)