Skip to content

Commit f49106b

Browse files
committed
Remove show extension workaround
1 parent 62b8b8e commit f49106b

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
@@ -193,9 +193,6 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
193193
protected val TreeMethodsImpl: TreeMethods
194194

195195
trait TreeMethods {
196-
// Dodo: Drop once extension methods have stabilized
197-
def temporaryShowAnsiColored(self: Tree): String = self.showAnsiColored
198-
def temporaryShow(self: Tree): String = self.show
199196

200197
extension (self: Tree):
201198
/** Position in the source code */

0 commit comments

Comments
 (0)