@@ -301,7 +301,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
301
301
302
302
object DefDef extends DefDefModule :
303
303
def apply (symbol : Symbol , rhsFn : List [List [Tree ]] => Option [Term ]): DefDef =
304
- xCheckMacroAssert(symbol.isTerm, s " expected a term symbol but received $symbol" )
304
+ xCheckMacroAssert(symbol.isTerm, s " expected a term symbol, but received $symbol" )
305
305
xCheckMacroAssert(symbol.flags.is(Flags .Method ), " expected a symbol with `Method` flag set" )
306
306
withDefaultPos(tpd.DefDef (symbol.asTerm, prefss =>
307
307
xCheckedMacroOwners(xCheckMacroValidExpr(rhsFn(prefss)), symbol).getOrElse(tpd.EmptyTree )
@@ -472,7 +472,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
472
472
def term (tp : TermRef ): Ref =
473
473
withDefaultPos(tpd.ref(tp).asInstanceOf [tpd.RefTree ])
474
474
def apply (sym : Symbol ): Ref =
475
- assert(sym.isTerm)
475
+ assert(sym.isTerm, s " expected a term symbol, but received $sym " )
476
476
val refTree = tpd.ref(sym) match
477
477
case t @ tpd.This (ident) => // not a RefTree, so we need to work around this - issue #19732
478
478
// ident in `This` can be a TypeIdent of sym, so we manually prepare the ref here,
@@ -1128,7 +1128,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
1128
1128
def of [T <: AnyKind ](using tp : scala.quoted.Type [T ]): TypeTree =
1129
1129
tp.asInstanceOf [TypeImpl ].typeTree
1130
1130
def ref (sym : Symbol ): TypeTree =
1131
- assert(sym.isType, " Expected a type symbol, but got " + sym)
1131
+ assert(sym.isType, s " Expected a type symbol, but got $ sym" )
1132
1132
tpd.ref(sym)
1133
1133
end TypeTree
1134
1134
@@ -1162,7 +1162,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
1162
1162
1163
1163
object TypeIdent extends TypeIdentModule :
1164
1164
def apply (sym : Symbol ): TypeTree =
1165
- assert(sym.isType)
1165
+ assert(sym.isType, s " Expected a type symbol, but got $sym " )
1166
1166
withDefaultPos(tpd.ref(sym).asInstanceOf [tpd.TypeTree ])
1167
1167
def copy (original : Tree )(name : String ): TypeIdent =
1168
1168
tpd.cpy.Ident (original)(name.toTypeName)
0 commit comments