Skip to content

Commit fcbb4f7

Browse files
committed
Use semantic names encoding in repl
1 parent a807b30 commit fcbb4f7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

repl/src/dotty/tools/repl/Repl.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ class Repl(
134134
else if (sym.is(Module)) "object"
135135
else "class"
136136

137-
println(SyntaxHighlighting(s"// defined $kind $name"))
137+
println(
138+
SyntaxHighlighting(s"// defined ").toString +
139+
SyntaxHighlighting(s"$kind $name").toString
140+
)
138141
}
139142

140143

repl/src/dotty/tools/repl/render.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import dotc.core.Symbols.Symbol
1212
object Rendering {
1313
/** Load the value of the symbol using reflection */
1414
private[this] def valueOf(sym: Symbol, classLoader: ClassLoader)(implicit ctx: Context): String = {
15-
val objectName = "$none$." + sym.owner.name.show
15+
val objectName = sym.owner.fullName.encode.toString
1616
val resObj: Class[_] = Class.forName(objectName, true, classLoader)
1717
val objInstance = resObj.newInstance()
1818
objInstance
1919
.getClass()
20-
.getDeclaredMethods.find(_.getName == sym.name.show).get
20+
.getDeclaredMethods.find(_.getName == sym.name.encode.toString).get
2121
.invoke(objInstance).toString
2222
}
2323

0 commit comments

Comments
 (0)