Skip to content

Commit 96c8bca

Browse files
Merge pull request #10501 from dotty-staging/remove-show-workaround
Remove `show` extension workaround
2 parents 546be93 + f49106b commit 96c8bca

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ object QuotesImpl {
2828
def apply()(using Context): Quotes =
2929
new QuotesImpl
3030

31-
def showDecompiledTree(tree: tpd.Tree)(using Context): String = {
31+
def showDecompiledTree(tree: tpd.Tree)(using Context): String =
32+
import qctx.reflect.TreeMethodsImpl.{showAnsiColored, show}
3233
val qctx: QuotesImpl = new QuotesImpl(using MacroExpansion.context(tree))
33-
if ctx.settings.color.value == "always" then
34-
qctx.reflect.TreeMethodsImpl.temporaryShowAnsiColored(tree)
35-
else
36-
qctx.reflect.TreeMethodsImpl.temporaryShow(tree)
37-
}
34+
if ctx.settings.color.value == "always" then showAnsiColored(tree)
35+
else show(tree)
3836

3937
// TODO Explore more fine grained scope ids.
4038
// This id can only differentiate scope extrusion from one compiler instance to another.

library/src/scala/quoted/Quotes.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,6 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
204204

205205
/** Extension methods of `Tree` */
206206
trait TreeMethods {
207-
// Dodo: Drop once extension methods have stabilized
208-
def temporaryShowAnsiColored(self: Tree): String = self.showAnsiColored
209-
def temporaryShow(self: Tree): String = self.show
210207

211208
extension (self: Tree):
212209
/** Position in the source code */

0 commit comments

Comments
 (0)