aboutsummaryrefslogtreecommitdiff
path: root/src/dotty
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala5
-rw-r--r--src/dotty/tools/dotc/core/Types.scala24
2 files changed, 4 insertions, 25 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index 54884a24c..dbde4d6f2 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -92,11 +92,6 @@ trait SymDenotations { this: Context =>
explain("denotation is not a SymDenotation")
}
}
-
- /** An anonymous type denotation with an info `>: Nothing <: Any`. Used to
- * avoid stackoverflows when computing members of TypeRefs
- */
- lazy val anyTypeDenot = new JointRefDenotation(NoSymbol, TypeBounds.empty, Period.allInRun(ctx.runId))
}
object SymDenotations {
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index a2b52d338..6f08971ec 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -1594,26 +1594,10 @@ object Types {
}
}
- protected def asMemberOf(prefix: Type)(implicit ctx: Context): Denotation = {
- // we might now get cycles over members that are in a refinement but that lack
- // a symbol. Without the following precaution i974.scala stackoverflows when compiled
- // with new hk scheme.
- // TODO: Do we still need the complications here?
- val savedDenot = lastDenotation
- val savedSymbol = lastSymbol
- if (prefix.isInstanceOf[RecThis] && name.isTypeName) {
- lastDenotation = ctx.anyTypeDenot
- lastSymbol = NoSymbol
- }
- try
- if (name.isShadowedName) prefix.nonPrivateMember(name.revertShadowed)
- else prefix.member(name)
- finally
- if (lastDenotation eq ctx.anyTypeDenot) {
- lastDenotation = savedDenot
- lastSymbol = savedSymbol
- }
- }
+ protected def asMemberOf(prefix: Type)(implicit ctx: Context): Denotation =
+ if (name.isShadowedName) prefix.nonPrivateMember(name.revertShadowed)
+ else prefix.member(name)
+
/** (1) Reduce a type-ref `W # X` or `W { ... } # U`, where `W` is a wildcard type
* to an (unbounded) wildcard type.