Skip to content

Commit 3a20cd4

Browse files
committed
Add reflect Flags.AbsOverride
1 parent 51bbee0 commit 3a20cd4

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

28012801
object Flags extends FlagsModule:
28022802
def Abstract: Flags = dotc.core.Flags.Abstract
2803+
def AbsOverride: Flags = dotc.core.Flags.AbsOverride
28032804
def Artifact: Flags = dotc.core.Flags.Artifact
28042805
def Case: Flags = dotc.core.Flags.Case
28052806
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
@@ -4373,6 +4373,18 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
43734373
/** Is this symbol `abstract` */
43744374
def Abstract: Flags
43754375

4376+
/** Is this symbol is labeled with of abstract & override
4377+
*
4378+
* The override modifier has an additional significance when combined with the abstract modifier.
4379+
* That modifier combination is only allowed for value members of traits.
4380+
*
4381+
* 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.
4382+
*
4383+
* Note that the abstract override modifier combination does not influence the concept whether a member is concrete or abstract.
4384+
* A member is abstract if only a declaration is given for it; it is concrete if a full definition is given.
4385+
*/
4386+
@experimental def AbsOverride: Flags
4387+
43764388
/** Is this generated by Scala compiler.
43774389
* Corresponds to ACC_SYNTHETIC in the JVM.
43784390
*/

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ val experimentalDefinitionInLibrary = Set(
6565
//// New APIs: Quotes
6666
// Should be stabilized in 3.4.0
6767
"scala.quoted.Quotes.reflectModule.defnModule.FunctionClass",
68+
"scala.quoted.Quotes.reflectModule.FlagsModule.AbsOverride",
6869
// Can be stabilized in 3.4.0 (unsure) or later
6970
"scala.quoted.Quotes.reflectModule.CompilationInfoModule.XmacroSettings",
7071
"scala.quoted.Quotes.reflectModule.FlagsModule.JavaAnnotation",

0 commit comments

Comments
 (0)