Skip to content

Commit 75c564b

Browse files
Backport "Make check flags for newMethod, newVal and newBind in Quotes API less restrictive" to LTS (#20719)
Backports #18217 to the LTS branch. PR submitted by the release tooling. [skip ci]
2 parents 332a486 + c0ef901 commit 75c564b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -2879,9 +2879,10 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
28792879
def Transparent: Flags = dotc.core.Flags.Transparent
28802880

28812881
// Keep: aligned with Quotes's `newMethod` doc
2882-
private[QuotesImpl] def validMethodFlags: Flags = Private | Protected | Override | Deferred | Final | Method | Implicit | Given | Local | AbsOverride | JavaStatic // Flags that could be allowed: Synthetic | ExtensionMethod | Exported | Erased | Infix | Invisible
2882+
private[QuotesImpl] def validMethodFlags: Flags = Private | Protected | Override | Deferred | Final | Method | Implicit | Given | Local | AbsOverride | JavaStatic | Synthetic | Artifact // Flags that could be allowed: Synthetic | ExtensionMethod | Exported | Erased | Infix | Invisible
28832883
// Keep: aligned with Quotes's `newVal` doc
2884-
private[QuotesImpl] def validValFlags: Flags = Private | Protected | Override | Deferred | Final | Param | Implicit | Lazy | Mutable | Local | ParamAccessor | Module | Package | Case | CaseAccessor | Given | Enum | AbsOverride | JavaStatic // Flags that could be added: Synthetic | Erased | Invisible
2884+
private[QuotesImpl] def validValFlags: Flags = Private | Protected | Override | Deferred | Final | Param | Implicit | Lazy | Mutable | Local | ParamAccessor | Module | Package | Case | CaseAccessor | Given | Enum | AbsOverride | JavaStatic | Synthetic | Artifact // Flags that could be added: Synthetic | Erased | Invisible
2885+
28852886
// Keep: aligned with Quotes's `newBind` doc
28862887
private[QuotesImpl] def validBindFlags: Flags = Case // Flags that could be allowed: Implicit | Given | Erased
28872888
end Flags

library/src/scala/quoted/Quotes.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -3785,7 +3785,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
37853785
* @param parent The owner of the method
37863786
* @param name The name of the method
37873787
* @param tpe The type of the method (MethodType, PolyType, ByNameType)
3788-
* @param flags extra flags to with which the symbol should be constructed. `Method` flag will be added. Can be `Private | Protected | Override | Deferred | Final | Method | Implicit | Given | Local | JavaStatic`
3788+
* @param flags extra flags to with which the symbol should be constructed. `Method` flag will be added. Can be `Private | Protected | Override | Deferred | Final | Method | Implicit | Given | Local | JavaStatic | Synthetic | Artifact`
37893789
* @param privateWithin the symbol within which this new method symbol should be private. May be noSymbol.
37903790
*/
37913791
// Keep: `flags` doc aligned with QuotesImpl's `validMethodFlags`
@@ -3802,7 +3802,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
38023802
* @param parent The owner of the val/var/lazy val
38033803
* @param name The name of the val/var/lazy val
38043804
* @param tpe The type of the val/var/lazy val
3805-
* @param flags extra flags to with which the symbol should be constructed. Can be `Private | Protected | Override | Deferred | Final | Param | Implicit | Lazy | Mutable | Local | ParamAccessor | Module | Package | Case | CaseAccessor | Given | Enum | JavaStatic`
3805+
* @param flags extra flags to with which the symbol should be constructed. Can be `Private | Protected | Override | Deferred | Final | Param | Implicit | Lazy | Mutable | Local | ParamAccessor | Module | Package | Case | CaseAccessor | Given | Enum | JavaStatic | Synthetic | Artifact`
38063806
* @param privateWithin the symbol within which this new method symbol should be private. May be noSymbol.
38073807
* @note As a macro can only splice code into the point at which it is expanded, all generated symbols must be
38083808
* direct or indirect children of the reflection context's owner.

0 commit comments

Comments
 (0)