Skip to content

Commit d1b7f2c

Browse files
committed
Address reviewer's comments
1 parent e7b045a commit d1b7f2c

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

compiler/src/dotty/tools/dotc/core/TypeOps.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
9090
else {
9191
val pre1 = asSeenFrom(tp.prefix, pre, cls, theMap)
9292
if (pre1.isUnsafeNonvariant) {
93-
val safeCtx = ctx.withProperty(TypeOps.findMemberLimit, Some(Config.PendingFindMemberLimit))
93+
val safeCtx = ctx.withProperty(TypeOps.findMemberLimit, Some(()))
9494
pre1.member(tp.name)(safeCtx).info match {
9595
case TypeAlias(alias) =>
9696
// try to follow aliases of this will avoid skolemization.
@@ -565,5 +565,5 @@ object TypeOps {
565565
* of recursive member searches. If the limit is reached, findMember returns
566566
* NoDenotation.
567567
*/
568-
val findMemberLimit = new Property.Key[Int]
568+
val findMemberLimit = new Property.Key[Unit]
569569
}

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,9 @@ object Types {
575575
ctx.findMemberCount = recCount
576576
if (recCount >= Config.LogPendingFindMemberThreshold) {
577577
ctx.pendingMemberSearches = name :: ctx.pendingMemberSearches
578-
ctx.property(TypeOps.findMemberLimit) match {
579-
case Some(limit) if ctx.findMemberCount > limit => return NoDenotation
580-
case _ =>
581-
}
578+
if (ctx.property(TypeOps.findMemberLimit).isDefined &&
579+
ctx.findMemberCount > Config.PendingFindMemberLimit)
580+
return NoDenotation
582581
}
583582
}
584583

0 commit comments

Comments
 (0)