Skip to content

Commit b1440d2

Browse files
committed
Revert complications in asMemberOf
We needed fairly specific code to make the refinement based hk encoding work without cyclic references. With the new encoding these complications are no longer needed.
1 parent 2dce908 commit b1440d2

File tree

2 files changed

+4
-25
lines changed

2 files changed

+4
-25
lines changed

src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ trait SymDenotations { this: Context =>
9292
explain("denotation is not a SymDenotation")
9393
}
9494
}
95-
96-
/** An anonymous type denotation with an info `>: Nothing <: Any`. Used to
97-
* avoid stackoverflows when computing members of TypeRefs
98-
*/
99-
lazy val anyTypeDenot = new JointRefDenotation(NoSymbol, TypeBounds.empty, Period.allInRun(ctx.runId))
10095
}
10196

10297
object SymDenotations {

src/dotty/tools/dotc/core/Types.scala

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,26 +1594,10 @@ object Types {
15941594
}
15951595
}
15961596

1597-
protected def asMemberOf(prefix: Type)(implicit ctx: Context): Denotation = {
1598-
// we might now get cycles over members that are in a refinement but that lack
1599-
// a symbol. Without the following precaution i974.scala stackoverflows when compiled
1600-
// with new hk scheme.
1601-
// TODO: Do we still need the complications here?
1602-
val savedDenot = lastDenotation
1603-
val savedSymbol = lastSymbol
1604-
if (prefix.isInstanceOf[RecThis] && name.isTypeName) {
1605-
lastDenotation = ctx.anyTypeDenot
1606-
lastSymbol = NoSymbol
1607-
}
1608-
try
1609-
if (name.isShadowedName) prefix.nonPrivateMember(name.revertShadowed)
1610-
else prefix.member(name)
1611-
finally
1612-
if (lastDenotation eq ctx.anyTypeDenot) {
1613-
lastDenotation = savedDenot
1614-
lastSymbol = savedSymbol
1615-
}
1616-
}
1597+
protected def asMemberOf(prefix: Type)(implicit ctx: Context): Denotation =
1598+
if (name.isShadowedName) prefix.nonPrivateMember(name.revertShadowed)
1599+
else prefix.member(name)
1600+
16171601

16181602
/** (1) Reduce a type-ref `W # X` or `W { ... } # U`, where `W` is a wildcard type
16191603
* to an (unbounded) wildcard type.

0 commit comments

Comments
 (0)