@@ -2540,13 +2540,15 @@ 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`" )
2544+ val privateWithin1 = if privateWithin.isTerm then Symbol .noSymbol else privateWithin
25442545 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 )
25462547 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
25482550 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 )
25502552 def newBind (owner : Symbol , name : String , flags : Flags , tpe : TypeRepr ): Symbol =
25512553 checkValidFlags(flags.toTermFlags, Flags .validBindFlags)
25522554 dotc.core.Symbols .newSymbol(owner, name.toTermName, flags | dotc.core.Flags .Case , tpe)
0 commit comments