@@ -709,7 +709,7 @@ object Types {
709709 final def implicitMembers (implicit ctx : Context ): List [TermRef ] = track(" implicitMembers" ) {
710710 memberDenots(implicitFilter,
711711 (name, buf) => buf ++= member(name).altsWith(_ is Implicit ))
712- .toList.map(d => TermRef .withSym (this , d.symbol.asTerm))
712+ .toList.map(d => TermRef (this , d.symbol.asTerm))
713713 }
714714
715715 /** The set of member classes of this type */
@@ -1141,7 +1141,7 @@ object Types {
11411141
11421142 /** The type <this . name> with either `sym` or its signed name as designator, reduced if possible */
11431143 def select (sym : Symbol )(implicit ctx : Context ): Type =
1144- NamedType .withSym (this , sym).reduceProjection
1144+ NamedType (this , sym).reduceProjection
11451145
11461146 def select (name : TermName )(implicit ctx : Context ): TermRef =
11471147 TermRef (this , name, member(name))
@@ -2019,43 +2019,32 @@ object Types {
20192019 def apply (prefix : Type , designator : Name , denot : Denotation )(implicit ctx : Context ) =
20202020 if (designator.isTermName) TermRef .apply(prefix, designator.asTermName, denot)
20212021 else TypeRef .apply(prefix, designator.asTypeName, denot)
2022- def withSym (prefix : Type , sym : Symbol )(implicit ctx : Context ): NamedType =
2023- if (sym.isType) TypeRef .withSym(prefix, sym.asType)
2024- else TermRef .withSym(prefix, sym.asTerm)
20252022 }
20262023
20272024 object TermRef {
20282025
2029- /** Create term ref with given name, without specifying a signature.
2030- * Its meaning is the (potentially multi-) denotation of the member(s)
2031- * of prefix with given name.
2032- */
2026+ /** Create a term ref with given designator */
20332027 def apply (prefix : Type , desig : Designator )(implicit ctx : Context ): TermRef =
20342028 ctx.uniqueNamedTypes.enterIfNew(prefix, desig, isTerm = true ).asInstanceOf [TermRef ]
20352029
2036- /** Create term ref to given initial denotation, taking the signature
2037- * from the denotation if it is completed, or creating a term ref without
2038- * signature, if denotation is not yet completed.
2030+ /** Create a term ref with given initial denotation. The name of the reference is taken
2031+ * from the denotation's symbol if the latter exists, or else it is the given name.
20392032 */
20402033 def apply (prefix : Type , name : TermName , denot : Denotation )(implicit ctx : Context ): TermRef =
20412034 apply(prefix, if (denot.symbol.exists) denot.symbol.asTerm else name).withDenot(denot)
2042-
2043- def withSym (prefix : Type , sym : TermSymbol )(implicit ctx : Context ): TermRef =
2044- apply(prefix, sym) // ###
20452035 }
20462036
20472037 object TypeRef {
20482038
2049- /** Create type ref with given prefix and name */
2039+ /** Create a type ref with given prefix and name */
20502040 def apply (prefix : Type , desig : Designator )(implicit ctx : Context ): TypeRef =
20512041 ctx.uniqueNamedTypes.enterIfNew(prefix, desig, isTerm = false ).asInstanceOf [TypeRef ]
20522042
2053- /** Create a type ref with given name and initial denotation */
2043+ /** Create a type ref with given initial denotation. The name of the reference is taken
2044+ * from the denotation's symbol if the latter exists, or else it is the given name.
2045+ */
20542046 def apply (prefix : Type , name : TypeName , denot : Denotation )(implicit ctx : Context ): TypeRef =
20552047 apply(prefix, if (denot.symbol.exists) denot.symbol.asType else name).withDenot(denot)
2056-
2057- def withSym (prefix : Type , sym : TypeSymbol )(implicit ctx : Context ): TypeRef =
2058- apply(prefix, sym) // ###
20592048 }
20602049
20612050 // --- Other SingletonTypes: ThisType/SuperType/ConstantType ---------------------------
0 commit comments