@@ -1923,12 +1923,13 @@ object Types {
1923
1923
override def equals (that : Any ) = that match {
1924
1924
case that : NamedType =>
1925
1925
this .designator == that.designator &&
1926
- this .prefix == that.prefix &&
1927
- ! that.isInstanceOf [WithFixedSym ]
1926
+ this .prefix == that.prefix
1928
1927
case _ =>
1929
1928
false
1930
1929
}
1931
1930
1931
+ override def computeHash = unsupported(" computeHash" )
1932
+
1932
1933
/* A version of toString which also prints aliases. Can be used for debugging
1933
1934
override def toString =
1934
1935
if (isTerm) s"TermRef($prefix, $name)"
@@ -2017,24 +2018,16 @@ object Types {
2017
2018
2018
2019
override def newLikeThis (prefix : Type )(implicit ctx : Context ): NamedType =
2019
2020
NamedType .withFixedSym(prefix, fixedSym)
2020
-
2021
- override def equals (that : Any ) = that match {
2022
- case that : WithFixedSym => this .prefix == that.prefix && (this .fixedSym eq that.fixedSym)
2023
- case _ => false
2024
- }
2025
- override def computeHash = unsupported(" computeHash" )
2026
2021
}
2027
2022
2028
2023
final class CachedTermRef (prefix : Type , designator : TermDesignator , hc : Int ) extends TermRef (prefix, designator) {
2029
2024
assert(prefix ne NoPrefix )
2030
2025
myHash = hc
2031
- override def computeHash = unsupported(" computeHash" )
2032
2026
}
2033
2027
2034
2028
final class CachedTypeRef (prefix : Type , designator : TypeDesignator , hc : Int ) extends TypeRef (prefix, designator) {
2035
2029
assert(prefix ne NoPrefix )
2036
2030
myHash = hc
2037
- override def computeHash = unsupported(" computeHash" )
2038
2031
}
2039
2032
2040
2033
// Those classes are non final as Linker extends them.
@@ -2073,7 +2066,7 @@ object Types {
2073
2066
* of prefix with given name.
2074
2067
*/
2075
2068
def apply (prefix : Type , designator : TermName )(implicit ctx : Context ): TermRef =
2076
- ctx.uniqueNamedTypes.enterIfNew(prefix, designator).asInstanceOf [TermRef ]
2069
+ ctx.uniqueNamedTypes.enterIfNew(prefix, designator, isTerm = true ).asInstanceOf [TermRef ]
2077
2070
2078
2071
/** Create term ref referring to given symbol, taking the signature
2079
2072
* from the symbol if it is completed, or creating a term ref without
@@ -2099,7 +2092,7 @@ object Types {
2099
2092
* with given prefix, name, and signature
2100
2093
*/
2101
2094
def withFixedSym (prefix : Type , name : TermName , sym : TermSymbol )(implicit ctx : Context ): TermRef =
2102
- ctx.uniqueWithFixedSyms .enterIfNew(prefix, name, sym ).asInstanceOf [TermRef ]
2095
+ ctx.uniqueNamedTypes .enterIfNew(prefix, sym, isTerm = true ).asInstanceOf [TermRef ]
2103
2096
2104
2097
/** Create a term ref referring to given symbol with given name, taking the signature
2105
2098
* from the symbol if it is completed, or creating a term ref without
@@ -2143,7 +2136,7 @@ object Types {
2143
2136
object TypeRef {
2144
2137
/** Create type ref with given prefix and name */
2145
2138
def apply (prefix : Type , name : TypeName )(implicit ctx : Context ): TypeRef =
2146
- ctx.uniqueNamedTypes.enterIfNew(prefix, name).asInstanceOf [TypeRef ]
2139
+ ctx.uniqueNamedTypes.enterIfNew(prefix, name, isTerm = false ).asInstanceOf [TypeRef ]
2147
2140
2148
2141
/** Create type ref to given symbol */
2149
2142
def apply (prefix : Type , sym : TypeSymbol )(implicit ctx : Context ): TypeRef =
@@ -2153,7 +2146,7 @@ object Types {
2153
2146
* with given prefix, name, and symbol.
2154
2147
*/
2155
2148
def withFixedSym (prefix : Type , name : TypeName , sym : TypeSymbol )(implicit ctx : Context ): TypeRef =
2156
- ctx.uniqueWithFixedSyms .enterIfNew(prefix, name, sym ).asInstanceOf [TypeRef ]
2149
+ ctx.uniqueNamedTypes .enterIfNew(prefix, sym, isTerm = false ).asInstanceOf [TypeRef ]
2157
2150
2158
2151
/** Create a type ref referring to given symbol with given name.
2159
2152
* This is very similar to TypeRef(Type, Symbol),
0 commit comments