Skip to content

Commit c221229

Browse files
committed
Add reflect Flags.AbsOverride
1 parent c466fa0 commit c221229

File tree

3 files changed

+14
-0
lines changed

3 files changed

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

27982798
object Flags extends FlagsModule:
27992799
def Abstract: Flags = dotc.core.Flags.Abstract
2800+
def AbsOverride: Flags = dotc.core.Flags.AbsOverride
28002801
def Artifact: Flags = dotc.core.Flags.Artifact
28012802
def Case: Flags = dotc.core.Flags.Case
28022803
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
@@ -4354,6 +4354,18 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
43544354
/** Is this symbol `abstract` */
43554355
def Abstract: Flags
43564356

4357+
/** Is this symbol is labeled with of abstract & override
4358+
*
4359+
* The override modifier has an additional significance when combined with the abstract modifier.
4360+
* That modifier combination is only allowed for value members of traits.
4361+
*
4362+
* 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.
4363+
*
4364+
* Note that the abstract override modifier combination does not influence the concept whether a member is concrete or abstract.
4365+
* A member is abstract if only a declaration is given for it; it is concrete if a full definition is given.
4366+
*/
4367+
@experimental def AbsOverride: Flags
4368+
43574369
/** Is this generated by Scala compiler.
43584370
* Corresponds to ACC_SYNTHETIC in the JVM.
43594371
*/

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ val experimentalDefinitionInLibrary = Set(
6969
//// New APIs: Quotes
7070
// Should be stabilized in 3.4.0
7171
"scala.quoted.Quotes.reflectModule.defnModule.FunctionClass",
72+
"scala.quoted.Quotes.reflectModule.FlagsModule.AbsOverride",
7273
// Can be stabilized in 3.4.0 (unsure) or later
7374
"scala.quoted.Quotes.reflectModule.CompilationInfoModule.XmacroSettings",
7475
"scala.quoted.Quotes.reflectModule.FlagsModule.JavaAnnotation",

0 commit comments

Comments
 (0)