File tree 1 file changed +7
-3
lines changed
src/dotty/tools/dotc/core 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2180,16 +2180,20 @@ object Types {
2180
2180
}
2181
2181
2182
2182
object RecType {
2183
+ /* Note: this might well fail for nested Recs.
2184
+ * Failing scenario: Rebind a nest rec, creates a new rec
2185
+ * but it still has RecThis references to the outer rec.
2183
2186
def checkInst(tp: Type)(implicit ctx: Context): tp.type = {
2184
2187
var binders: List[RecType] = Nil
2185
2188
tp.foreachPart {
2186
2189
case rt: RecType => binders = rt :: binders
2187
- case rt : RecThis => assert(binders contains rt.binder, tp )
2190
+ case rt: RecThis => assert(binders contains rt.binder)
2188
2191
case _ =>
2189
2192
}
2190
2193
tp
2191
2194
}
2192
- def apply (parentExp : RecType => Type )(implicit ctx : Context ): RecType = checkInst {
2195
+ */
2196
+ def apply (parentExp : RecType => Type )(implicit ctx : Context ): RecType = {
2193
2197
var rt = new RecType (parentExp)
2194
2198
rt.parent match {
2195
2199
case rt2 : RecType =>
@@ -2198,7 +2202,7 @@ object Types {
2198
2202
}
2199
2203
unique(rt)
2200
2204
}
2201
- def closeOver (parentExp : RecType => Type )(implicit ctx : Context ) = checkInst {
2205
+ def closeOver (parentExp : RecType => Type )(implicit ctx : Context ) = {
2202
2206
val rt = this (parentExp)
2203
2207
// val self = RecThis(rt)
2204
2208
def isSelfRef (t : Type ) = t match {
You can’t perform that action at this time.
0 commit comments