@@ -1167,8 +1167,10 @@ object Types {
1167
1167
def apply (prefix : Type , name : TermName )(implicit ctx : Context ): TermRef =
1168
1168
ctx.uniqueNamedTypes.enterIfNew(prefix, name).asInstanceOf [TermRef ]
1169
1169
def apply (prefix : Type , sym : TermSymbol )(implicit ctx : Context ): TermRef =
1170
- if (prefix eq NoPrefix ) unique(new NoPrefixTermRef (sym.name, sym))
1171
- else apply(prefix, sym.name) withSym sym
1170
+ withSymAndName(prefix, sym, sym.name)
1171
+ def withSymAndName (prefix : Type , sym : TermSymbol , name : TermName )(implicit ctx : Context ): TermRef =
1172
+ if (prefix eq NoPrefix ) unique(new NoPrefixTermRef (name, sym))
1173
+ else apply(prefix, name) withSym sym
1172
1174
def apply (prefix : Type , name : TermName , denot : Denotation )(implicit ctx : Context ): TermRef =
1173
1175
(if (prefix eq NoPrefix ) apply(prefix, denot.symbol.asTerm) else apply(prefix, name)) withDenot denot
1174
1176
def withSig (prefix : Type , name : TermName , sig : Signature )(implicit ctx : Context ): TermRef =
@@ -1182,8 +1184,10 @@ object Types {
1182
1184
def apply (prefix : Type , name : TypeName )(implicit ctx : Context ): TypeRef =
1183
1185
ctx.uniqueNamedTypes.enterIfNew(prefix, name).asInstanceOf [TypeRef ]
1184
1186
def apply (prefix : Type , sym : TypeSymbol )(implicit ctx : Context ): TypeRef =
1185
- if (prefix eq NoPrefix ) unique(new NoPrefixTypeRef (sym.name, sym))
1186
- else apply(prefix, sym.name) withSym sym
1187
+ withSymAndName(prefix, sym, sym.name)
1188
+ def withSymAndName (prefix : Type , sym : TypeSymbol , name : TypeName )(implicit ctx : Context ): TypeRef =
1189
+ if (prefix eq NoPrefix ) unique(new NoPrefixTypeRef (name, sym))
1190
+ else apply(prefix, name) withSym sym
1187
1191
def apply (prefix : Type , name : TypeName , denot : Denotation )(implicit ctx : Context ): TypeRef =
1188
1192
(if (prefix eq NoPrefix ) apply(prefix, denot.symbol.asType) else apply(prefix, name)) withDenot denot
1189
1193
}
0 commit comments