diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index ce8d19aae46a..7d851947fb16 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -542,6 +542,9 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler withDefaultPos(tpd.applyOverloaded(qualifier, name.toTermName, args, targs, returnType)) def copy(original: Tree)(qualifier: Term, name: String): Select = tpd.cpy.Select(original)(qualifier, name.toTermName) + + def copy(original: Tree)(qualifier: Term, sym: Symbol): Select = + tpd.cpy.Select(original)(qualifier, sym.name) def unapply(x: Select): (Term, String) = (x.qualifier, x.name.toString) end Select diff --git a/library/src/scala/quoted/Quotes.scala b/library/src/scala/quoted/Quotes.scala index d048d8d728d5..0206ff26bc7f 100644 --- a/library/src/scala/quoted/Quotes.scala +++ b/library/src/scala/quoted/Quotes.scala @@ -996,6 +996,8 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => def copy(original: Tree)(qualifier: Term, name: String): Select + def copy(original: Tree)(qualifier: Term, sym: Symbol): Select + /** Matches `.` */ def unapply(x: Select): (Term, String) } @@ -5083,7 +5085,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => case Ident(name) => tree case Select(qualifier, name) => - Select.copy(tree)(transformTerm(qualifier)(owner), name) + Select.copy(tree)(transformTerm(qualifier)(owner), tree.symbol) case This(qual) => tree case Super(qual, mix) =>