@@ -2504,6 +2504,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
25042504
25052505 def newModule (owner : Symbol , name : String , modFlags : Flags , clsFlags : Flags , parents : List [TypeRepr ], decls : Symbol => List [Symbol ], privateWithin : Symbol ): Symbol =
25062506 assert(parents.nonEmpty && ! parents.head.typeSymbol.is(dotc.core.Flags .Trait ), " First parent must be a class" )
2507+ assert(! privateWithin.exists || privateWithin.isType, " privateWithin must be a type symbol or `Symbol.noSymbol`" )
25072508 val mod = dotc.core.Symbols .newNormalizedModuleSymbol(
25082509 owner,
25092510 name.toTermName,
@@ -2520,8 +2521,10 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
25202521 def newMethod (owner : Symbol , name : String , tpe : TypeRepr ): Symbol =
25212522 newMethod(owner, name, tpe, Flags .EmptyFlags , noSymbol)
25222523 def newMethod (owner : Symbol , name : String , tpe : TypeRepr , flags : Flags , privateWithin : Symbol ): Symbol =
2524+ assert(! privateWithin.exists || privateWithin.isType, " privateWithin must be a type symbol or `Symbol.noSymbol`" )
25232525 dotc.core.Symbols .newSymbol(owner, name.toTermName, flags | dotc.core.Flags .Method , tpe, privateWithin)
25242526 def newVal (owner : Symbol , name : String , tpe : TypeRepr , flags : Flags , privateWithin : Symbol ): Symbol =
2527+ assert(! privateWithin.exists || privateWithin.isType, " privateWithin must be a type symbol or `Symbol.noSymbol`" )
25252528 dotc.core.Symbols .newSymbol(owner, name.toTermName, flags, tpe, privateWithin)
25262529 def newBind (owner : Symbol , name : String , flags : Flags , tpe : TypeRepr ): Symbol =
25272530 dotc.core.Symbols .newSymbol(owner, name.toTermName, flags | Case , tpe)
0 commit comments