Skip to content

Commit d03ac8f

Browse files
committed
.
1 parent 4891858 commit d03ac8f

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

compiler/src/dotty/tools/repl/Rendering.scala

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,7 @@ private[repl] class Rendering(parentClassLoader: Option[ClassLoader] = None):
9595

9696
/** Return a String representation of a value we got from `classLoader()`. */
9797
private[repl] def replStringOf(sym: Symbol, value: Object)(using Context): String =
98-
assert(myReplStringOf != null,
99-
"replStringOf should only be called on values creating using `classLoader()`, but `classLoader()` has not been called so far")
100-
val maxPrintElements = ctx.settings.VreplMaxPrintElements.valueIn(ctx.settingsState)
101-
val maxPrintCharacters = ctx.settings.VreplMaxPrintCharacters.valueIn(ctx.settingsState)
102-
// stringOf returns null if value.toString returns null. Show some text as a fallback.
103-
def fallback = s"""null // result of "${sym.name}.toString" is null"""
104-
if value == null then "null" else
105-
myReplStringOf(value, maxPrintElements, maxPrintCharacters) match
106-
case null => fallback
107-
case res => res
108-
end if
98+
pprint.PPrinter.BlackWhite.apply(value).toString
10999

110100
/** Load the value of the symbol using reflection.
111101
*

project/Build.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ object Build {
251251
"-deprecation",
252252
"-unchecked",
253253
//"-Wconf:cat=deprecation&msg=Unsafe:s", // example usage
254-
"-Xfatal-warnings", // -Werror in modern usage
254+
//"-Xfatal-warnings", // -Werror in modern usage
255255
"-encoding", "UTF8",
256256
"-language:implicitConversions",
257257
),
@@ -698,8 +698,8 @@ object Build {
698698
"org.jline" % "jline-terminal" % "3.25.1",
699699
"org.jline" % "jline-terminal-jna" % "3.25.1", // needed for Windows
700700
("io.get-coursier" %% "coursier" % "2.0.16" % Test).cross(CrossVersion.for3Use2_13),
701+
"com.lihaoyi" %% "pprint" % "0.9.3",
701702
),
702-
703703
// For convenience, change the baseDirectory when running the compiler
704704
Compile / forkOptions := (Compile / forkOptions).value.withWorkingDirectory((ThisBuild / baseDirectory).value),
705705
Compile / run / forkOptions := (Compile / run / forkOptions).value.withWorkingDirectory((ThisBuild / baseDirectory).value),
@@ -1153,7 +1153,7 @@ object Build {
11531153
Compile / doc / scalacOptions += "-Ydocument-synthetic-types",
11541154
scalacOptions += "-Ycompile-scala2-library",
11551155
scalacOptions += "-Yscala2Unpickler:never",
1156-
scalacOptions -= "-Xfatal-warnings",
1156+
// scalacOptions -= "-Xfatal-warnings",
11571157
Compile / compile / logLevel.withRank(KeyRanks.Invisible) := Level.Error,
11581158
ivyConfigurations += SourceDeps.hide,
11591159
transitiveClassifiers := Seq("sources"),

0 commit comments

Comments
 (0)