Skip to content

Commit 749dfb0

Browse files
committed
Only check newVal/newMethod privateWithin on -Xcheck-macros
Closes #17432
1 parent 830230f commit 749dfb0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2540,11 +2540,11 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
25402540
def newMethod(owner: Symbol, name: String, tpe: TypeRepr): Symbol =
25412541
newMethod(owner, name, tpe, Flags.EmptyFlags, noSymbol)
25422542
def newMethod(owner: Symbol, name: String, tpe: TypeRepr, flags: Flags, privateWithin: Symbol): Symbol =
2543-
assert(!privateWithin.exists || privateWithin.isType, "privateWithin must be a type symbol or `Symbol.noSymbol`")
2543+
xCheckMacroAssert(!privateWithin.exists || privateWithin.isType, "privateWithin must be a type symbol or `Symbol.noSymbol`")
25442544
checkValidFlags(flags.toTermFlags, Flags.validMethodFlags)
25452545
dotc.core.Symbols.newSymbol(owner, name.toTermName, flags | dotc.core.Flags.Method, tpe, privateWithin)
25462546
def newVal(owner: Symbol, name: String, tpe: TypeRepr, flags: Flags, privateWithin: Symbol): Symbol =
2547-
assert(!privateWithin.exists || privateWithin.isType, "privateWithin must be a type symbol or `Symbol.noSymbol`")
2547+
xCheckMacroAssert(!privateWithin.exists || privateWithin.isType, "privateWithin must be a type symbol or `Symbol.noSymbol`")
25482548
checkValidFlags(flags.toTermFlags, Flags.validValFlags)
25492549
dotc.core.Symbols.newSymbol(owner, name.toTermName, flags, tpe, privateWithin)
25502550
def newBind(owner: Symbol, name: String, flags: Flags, tpe: TypeRepr): Symbol =

0 commit comments

Comments
 (0)