@@ -2020,7 +2020,7 @@ object Types {
2020
2020
case that : WithFixedSym => this .prefix == that.prefix && (this .fixedSym eq that.fixedSym)
2021
2021
case _ => false
2022
2022
}
2023
- override def computeHash = doHash(fixedSym, prefix )
2023
+ override def computeHash = unsupported( " computeHash " )
2024
2024
}
2025
2025
2026
2026
final class CachedTermRef (prefix : Type , name : TermName , hc : Int ) extends TermRef (prefix, name) {
@@ -2036,8 +2036,12 @@ object Types {
2036
2036
}
2037
2037
2038
2038
// Those classes are non final as Linker extends them.
2039
- class TermRefWithFixedSym (prefix : Type , name : TermName , val fixedSym : TermSymbol ) extends TermRef (prefix, name) with WithFixedSym
2040
- class TypeRefWithFixedSym (prefix : Type , name : TypeName , val fixedSym : TypeSymbol ) extends TypeRef (prefix, name) with WithFixedSym
2039
+ class TermRefWithFixedSym (prefix : Type , name : TermName , val fixedSym : TermSymbol , hc : Int ) extends TermRef (prefix, name) with WithFixedSym {
2040
+ myHash = hc
2041
+ }
2042
+ class TypeRefWithFixedSym (prefix : Type , name : TypeName , val fixedSym : TypeSymbol , hc : Int ) extends TypeRef (prefix, name) with WithFixedSym {
2043
+ myHash = hc
2044
+ }
2041
2045
2042
2046
/** Assert current phase does not have erasure semantics */
2043
2047
private def assertUnerased ()(implicit ctx : Context ) =
@@ -2094,7 +2098,7 @@ object Types {
2094
2098
* with given prefix, name, and signature
2095
2099
*/
2096
2100
def withFixedSym (prefix : Type , name : TermName , sym : TermSymbol )(implicit ctx : Context ): TermRef =
2097
- unique( new TermRefWithFixedSym ( prefix, name, sym))
2101
+ ctx.uniqueWithFixedSyms.enterIfNew( prefix, name, sym). asInstanceOf [ TermRef ]
2098
2102
2099
2103
/** Create a term ref referring to given symbol with given name, taking the signature
2100
2104
* from the symbol if it is completed, or creating a term ref without
@@ -2148,7 +2152,7 @@ object Types {
2148
2152
* with given prefix, name, and symbol.
2149
2153
*/
2150
2154
def withFixedSym (prefix : Type , name : TypeName , sym : TypeSymbol )(implicit ctx : Context ): TypeRef =
2151
- unique( new TypeRefWithFixedSym ( prefix, name, sym))
2155
+ ctx.uniqueWithFixedSyms.enterIfNew( prefix, name, sym). asInstanceOf [ TypeRef ]
2152
2156
2153
2157
/** Create a type ref referring to given symbol with given name.
2154
2158
* This is very similar to TypeRef(Type, Symbol),
0 commit comments