@@ -2020,7 +2020,7 @@ object Types {
20202020 case that : WithFixedSym => this .prefix == that.prefix && (this .fixedSym eq that.fixedSym)
20212021 case _ => false
20222022 }
2023- override def computeHash = doHash(fixedSym, prefix )
2023+ override def computeHash = unsupported( " computeHash " )
20242024 }
20252025
20262026 final class CachedTermRef (prefix : Type , name : TermName , hc : Int ) extends TermRef (prefix, name) {
@@ -2036,8 +2036,12 @@ object Types {
20362036 }
20372037
20382038 // 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+ }
20412045
20422046 /** Assert current phase does not have erasure semantics */
20432047 private def assertUnerased ()(implicit ctx : Context ) =
@@ -2094,7 +2098,7 @@ object Types {
20942098 * with given prefix, name, and signature
20952099 */
20962100 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 ]
20982102
20992103 /** Create a term ref referring to given symbol with given name, taking the signature
21002104 * from the symbol if it is completed, or creating a term ref without
@@ -2148,7 +2152,7 @@ object Types {
21482152 * with given prefix, name, and symbol.
21492153 */
21502154 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 ]
21522156
21532157 /** Create a type ref referring to given symbol with given name.
21542158 * This is very similar to TypeRef(Type, Symbol),
0 commit comments