aboutsummaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-12-21 20:20:44 +0100
committerMartin Odersky <odersky@gmail.com>2016-12-21 20:20:44 +0100
commitd1b7f2c39561ae64c95b94242fe3bc91beb8af25 (patch)
tree86447535e894c20ae01143e786439f595e4e7887 /compiler
parente7b045a2fa9b1196465b388393ab23ce5979616e (diff)
downloaddotty-d1b7f2c39561ae64c95b94242fe3bc91beb8af25.tar.gz
dotty-d1b7f2c39561ae64c95b94242fe3bc91beb8af25.tar.bz2
dotty-d1b7f2c39561ae64c95b94242fe3bc91beb8af25.zip
Address reviewer's comments
Diffstat (limited to 'compiler')
-rw-r--r--compiler/src/dotty/tools/dotc/core/TypeOps.scala4
-rw-r--r--compiler/src/dotty/tools/dotc/core/Types.scala7
2 files changed, 5 insertions, 6 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/TypeOps.scala b/compiler/src/dotty/tools/dotc/core/TypeOps.scala
index be8dc2713..db73daaa2 100644
--- a/compiler/src/dotty/tools/dotc/core/TypeOps.scala
+++ b/compiler/src/dotty/tools/dotc/core/TypeOps.scala
@@ -90,7 +90,7 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
else {
val pre1 = asSeenFrom(tp.prefix, pre, cls, theMap)
if (pre1.isUnsafeNonvariant) {
- val safeCtx = ctx.withProperty(TypeOps.findMemberLimit, Some(Config.PendingFindMemberLimit))
+ val safeCtx = ctx.withProperty(TypeOps.findMemberLimit, Some(()))
pre1.member(tp.name)(safeCtx).info match {
case TypeAlias(alias) =>
// try to follow aliases of this will avoid skolemization.
@@ -565,5 +565,5 @@ object TypeOps {
* of recursive member searches. If the limit is reached, findMember returns
* NoDenotation.
*/
- val findMemberLimit = new Property.Key[Int]
+ val findMemberLimit = new Property.Key[Unit]
}
diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala
index dcc1019e4..64fa48071 100644
--- a/compiler/src/dotty/tools/dotc/core/Types.scala
+++ b/compiler/src/dotty/tools/dotc/core/Types.scala
@@ -575,10 +575,9 @@ object Types {
ctx.findMemberCount = recCount
if (recCount >= Config.LogPendingFindMemberThreshold) {
ctx.pendingMemberSearches = name :: ctx.pendingMemberSearches
- ctx.property(TypeOps.findMemberLimit) match {
- case Some(limit) if ctx.findMemberCount > limit => return NoDenotation
- case _ =>
- }
+ if (ctx.property(TypeOps.findMemberLimit).isDefined &&
+ ctx.findMemberCount > Config.PendingFindMemberLimit)
+ return NoDenotation
}
}