File tree 2 files changed +7
-4
lines changed
compiler/src/dotty/tools/dotc/core 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import NameOps._
7
7
import StdNames ._
8
8
import NameTags ._
9
9
import Contexts ._
10
+ import Decorators ._
10
11
import collection .mutable
11
12
12
13
import scala .annotation .internal .sharable
@@ -208,6 +209,8 @@ object NameKinds {
208
209
extends NumberedNameKind (UNIQUE , s " Unique $separator" ) {
209
210
override def definesNewName : Boolean = true
210
211
212
+ val separatorName = separator.toTermName
213
+
211
214
def mkString (underlying : TermName , info : ThisInfo ): String = {
212
215
val safePrefix = str.sanitize(underlying.toString) + separator
213
216
safePrefix + info.num
@@ -226,10 +229,10 @@ object NameKinds {
226
229
227
230
/** An extractor for unique names of arbitrary kind */
228
231
object AnyUniqueName {
229
- def unapply (name : DerivedName ): Option [(TermName , String , Int )] = name match {
232
+ def unapply (name : DerivedName ): Option [(TermName , TermName , Int )] = name match {
230
233
case DerivedName (qual, info : NumberedInfo ) =>
231
234
info.kind match {
232
- case unique : UniqueNameKind => Some ((qual, unique.separator , info.num))
235
+ case unique : UniqueNameKind => Some ((qual, unique.separatorName , info.num))
233
236
case _ => None
234
237
}
235
238
case _ => None
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class NameBuffer extends TastyBuffer(10000) {
35
35
case AnyQualifiedName (prefix, name) =>
36
36
nameIndex(prefix); nameIndex(name)
37
37
case AnyUniqueName (original, separator, num) =>
38
- nameIndex(separator.toTermName )
38
+ nameIndex(separator)
39
39
if (! original.isEmpty) nameIndex(original)
40
40
case DerivedName (original, _) =>
41
41
nameIndex(original)
@@ -82,7 +82,7 @@ class NameBuffer extends TastyBuffer(10000) {
82
82
withLength { writeNameRef(prefix); writeNameRef(name) }
83
83
case AnyUniqueName (original, separator, num) =>
84
84
withLength {
85
- writeNameRef(separator.toTermName )
85
+ writeNameRef(separator)
86
86
writeNat(num)
87
87
if (! original.isEmpty) writeNameRef(original)
88
88
}
You can’t perform that action at this time.
0 commit comments