File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff 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)
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments