Skip to content

Fix #830: Compiler hangs on implicit search with singleton &/| #843

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 2 commits into from
Oct 25, 2015

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Oct 22, 2015

In fact we get a deep subtype recursion when compileing i830.scala. The problem
goes away once we make use of the fact that the intersection of two singleton
types which are not subtypes of each other is empty. Review by @smarter

In fact we get a deep subtype recursion when compileing i830.scala. The problem
goes away once we make use of the fact that the intersection of two singleton
types which are not subtypes of each other is empty.
@odersky
Copy link
Contributor Author

odersky commented Oct 23, 2015

@smarter How does it look now?

@smarter
Copy link
Member

smarter commented Oct 23, 2015

The change LGTM but note that the following still causes an infinite loop:

object C {
  val a: Int = 1
  val b: Int = 2
  val c: Int = 2

  trait X[T]
  implicit def u[A, B]: X[A | B] = new X[A | B] {}
  def y[T](implicit x: X[T]): T = ???
  val x: a.type & b.type | b.type & c.type = y
}

odersky added a commit that referenced this pull request Oct 25, 2015
Fix #830: Compiler hangs on implicit search with singleton &/|
@odersky odersky merged commit ecf62cf into scala:master Oct 25, 2015
@allanrenucci allanrenucci deleted the fix-#830 branch December 14, 2017 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants