Skip to content

Commit 50a9dd1

Browse files
committed
Drop prettifying & generalise to all
1 parent 3a84717 commit 50a9dd1

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

compiler/src/dotty/tools/dotc/core/Decorators.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ object Decorators {
274274
s"[cannot display due to $msg, raw string = $x]"
275275
case _ => String.valueOf(x).nn
276276

277+
/** Returns the simple class name of `x`. */
278+
def className: String = getClass.getSimpleName.nn
279+
277280
extension [T](x: T)
278281
def assertingErrorsReported(using Context): T = {
279282
assert(ctx.reporter.errorsReported)

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,14 +1906,6 @@ object Types {
19061906
case _ => show
19071907
}
19081908

1909-
/** Returns the shortened and slightly prettified name of the class of the type. */
1910-
def className: String =
1911-
def go(s: String): String =
1912-
import Predef.augmentString // "import Texts._" imports the conversion to Text, which has a stripPrefix
1913-
val s2 = s.stripPrefix("Cached").stripPrefix("Real").stripSuffix("Impl").stripSuffix("$")
1914-
if s == s2 then s2 else go(s2)
1915-
go(getClass.getSimpleName.nn)
1916-
19171909
/** A simplified version of this type which is equivalent wrt =:= to this type.
19181910
* This applies a typemap to the type which (as all typemaps) follows type
19191911
* variable instances and reduces typerefs over refined types. It also

0 commit comments

Comments
 (0)