1
1
package dotty .tools .dotc
2
2
package core
3
3
4
- import Types ._ , Symbols ._ , Contexts ._ , util .Stats ._ , Hashable ._ , Names ._
4
+ import Types ._ , Symbols ._ , Contexts ._ , util .Stats ._ , Hashable ._ , Names ._ , Designators . _
5
5
import config .Config
6
6
import util .HashSet
7
7
@@ -43,7 +43,7 @@ object Uniques {
43
43
final class NamedTypeUniques extends HashSet [NamedType ](Config .initialUniquesCapacity) with Hashable {
44
44
override def hash (x : NamedType ): Int = x.hash
45
45
46
- private def findPrevious (h : Int , prefix : Type , designator : Name ): NamedType = {
46
+ private def findPrevious (h : Int , prefix : Type , designator : Designator ): NamedType = {
47
47
var e = findEntryByHash(h)
48
48
while (e != null ) {
49
49
if ((e.prefix eq prefix) && (e.designator eq designator)) return e
@@ -52,12 +52,12 @@ object Uniques {
52
52
e
53
53
}
54
54
55
- def enterIfNew (prefix : Type , designator : Name )(implicit ctx : Context ): NamedType = {
55
+ def enterIfNew (prefix : Type , designator : Designator )(implicit ctx : Context ): NamedType = {
56
56
val h = doHash(designator, prefix)
57
57
if (monitored) recordCaching(h, classOf [NamedType ])
58
58
def newType = {
59
- if (designator.isTypeName ) new CachedTypeRef (prefix, designator.asTypeName , h)
60
- else new CachedTermRef (prefix, designator.asTermName , h)
59
+ if (designator.isType ) new CachedTypeRef (prefix, designator.asType , h)
60
+ else new CachedTermRef (prefix, designator.asTerm , h)
61
61
}.init()
62
62
if (h == NotCached ) newType
63
63
else {
0 commit comments