File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -149,11 +149,11 @@ object Contexts {
149
149
150
150
def nextId = { _nextId += 1 ; _nextId }
151
151
152
- /** A map from a superclass id to the class that has it */
153
- private [core] var classOfId = new Array [ClassSymbol ](InitialSuperIdsSize )
152
+ /** A map from a superclass id to the type-ref of the class that has it */
153
+ private [core] var classOfId = new Array [TypeRef ](InitialSuperIdsSize )
154
154
155
- /** A map from a superclass to its superclass id */
156
- private [core] val superIdOfClass = new mutable.HashMap [ClassSymbol , Int ]
155
+ /** A map from a the type-ref of a superclass to its superclass id */
156
+ private [core] val superIdOfClass = new mutable.HashMap [TypeRef , Int ]
157
157
158
158
/** The last allocate superclass id */
159
159
private [core] var lastSuperId = - 1
@@ -162,7 +162,7 @@ object Contexts {
162
162
private [core] def nextSuperId : Int = {
163
163
lastSuperId += 1 ;
164
164
if (lastSuperId >= classOfId.length) {
165
- val tmp = new Array [ClassSymbol ](classOfId.length * 2 )
165
+ val tmp = new Array [TypeRef ](classOfId.length * 2 )
166
166
classOfId.copyToArray(tmp)
167
167
classOfId = tmp
168
168
}
Original file line number Diff line number Diff line change @@ -185,15 +185,16 @@ object Symbols {
185
185
186
186
def superId (implicit ctx : Context ): Int = {
187
187
val hint = superIdHint
188
- if (hint >= 0 && hint <= ctx.lastSuperId && (ctx.classOfId(hint) eq this )) hint
188
+ val key = this .typeConstructor
189
+ if (hint >= 0 && hint <= ctx.lastSuperId && (ctx.classOfId(hint) eq key)) hint
189
190
else {
190
- val id = ctx.superIdOfClass get this match {
191
+ val id = ctx.superIdOfClass get key match {
191
192
case Some (id) =>
192
193
id
193
194
case None =>
194
195
val id = ctx.nextSuperId
195
- ctx.superIdOfClass(this ) = id
196
- ctx.classOfId(id) = this
196
+ ctx.superIdOfClass(key ) = id
197
+ ctx.classOfId(id) = key
197
198
id
198
199
}
199
200
superIdHint = id
You can’t perform that action at this time.
0 commit comments