File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -258,6 +258,15 @@ object Names {
258258 val (first, last, sep) = split
259259 if (first.isEmpty) f2(last) else str.sanitize(f1(first) + sep + f2(last))
260260 }
261+
262+ protected def computeToString : String
263+
264+ @ sharable private var myToString : String = null
265+
266+ override def toString =
267+ if myToString == null then myToString = computeToString
268+ myToString
269+
261270 }
262271
263272 /** A simple name is essentially an interned string */
@@ -371,7 +380,7 @@ object Names {
371380
372381 override def hashCode : Int = start
373382
374- override def toString : String =
383+ protected def computeToString : String =
375384 if (length == 0 ) " "
376385 else {
377386 if (Config .checkBackendNames)
@@ -500,7 +509,7 @@ object Names {
500509 case qual : QualifiedInfo => qual.name
501510 case _ => underlying.lastPart
502511 }
503- override def toString : String = info.mkString(underlying)
512+ protected def computeToString : String = info.mkString(underlying)
504513 override def debugString : String = s " ${underlying.debugString}[ $info] "
505514 }
506515
You can’t perform that action at this time.
0 commit comments