@@ -2540,13 +2540,15 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
2540
2540
def newMethod (owner : Symbol , name : String , tpe : TypeRepr ): Symbol =
2541
2541
newMethod(owner, name, tpe, Flags .EmptyFlags , noSymbol)
2542
2542
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`" )
2544
+ val privateWithin1 = if privateWithin.isTerm then Symbol .noSymbol else privateWithin
2544
2545
checkValidFlags(flags.toTermFlags, Flags .validMethodFlags)
2545
- dotc.core.Symbols .newSymbol(owner, name.toTermName, flags | dotc.core.Flags .Method , tpe, privateWithin )
2546
+ dotc.core.Symbols .newSymbol(owner, name.toTermName, flags | dotc.core.Flags .Method , tpe, privateWithin1 )
2546
2547
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`" )
2548
+ xCheckMacroAssert(! privateWithin.exists || privateWithin.isType, " privateWithin must be a type symbol or `Symbol.noSymbol`" )
2549
+ val privateWithin1 = if privateWithin.isTerm then Symbol .noSymbol else privateWithin
2548
2550
checkValidFlags(flags.toTermFlags, Flags .validValFlags)
2549
- dotc.core.Symbols .newSymbol(owner, name.toTermName, flags, tpe, privateWithin )
2551
+ dotc.core.Symbols .newSymbol(owner, name.toTermName, flags, tpe, privateWithin1 )
2550
2552
def newBind (owner : Symbol , name : String , flags : Flags , tpe : TypeRepr ): Symbol =
2551
2553
checkValidFlags(flags.toTermFlags, Flags .validBindFlags)
2552
2554
dotc.core.Symbols .newSymbol(owner, name.toTermName, flags | dotc.core.Flags .Case , tpe)
0 commit comments