Skip to content

Don't force LazyRefs when computing isProvisional #4082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ object Types {

// ----- Tests -----------------------------------------------------

// debug only: a unique identifier for a type
val uniqId = {
nextId = nextId + 1
// // debug only: a unique identifier for a type
// val uniqId = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this get turned off?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a field in every type, and we don't need it - it's used nowhere.

// nextId = nextId + 1
// if (nextId == 19555)
// println("foo")
nextId
}
// nextId
// }

/** A cache indicating whether the type was still provisional, last time we checked */
@sharable private var mightBeProvisional = true
Expand Down Expand Up @@ -122,6 +122,8 @@ object Types {
case _ => false
}
}
case t: LazyRef =>
!t.completed || apply(x, t.ref)
case _ =>
foldOver(x, t)
}
Expand Down Expand Up @@ -2260,6 +2262,7 @@ object Types {
myRef
}
def evaluating = computed && myRef == null
def completed = myRef != null
override def underlying(implicit ctx: Context) = ref
override def toString = s"LazyRef(${if (computed) myRef else "..."})"
override def equals(other: Any) = this.eq(other.asInstanceOf[AnyRef])
Expand Down