Skip to content
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

compiler freezes when typing an eta expansion involving a type constructor #8060

Closed
scabug opened this issue Dec 10, 2013 · 2 comments
Closed

compiler freezes when typing an eta expansion involving a type constructor #8060

scabug opened this issue Dec 10, 2013 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Dec 10, 2013

You know, if I could get through one freaking day without some all-new bug paralyzing development for an hour or two at least, it would be some wonderful dream. I'm not even asking not to discover new compiler bugs every single day, I'm not greedy. I'd just like to enjoy the occasional day when I don't have to whittle down a few hundred lines of code to find out why sbt freezes every time I try to run the tests, or whatever the day's manifestation is.

This freezes in typer.

trait M[F[_]]

trait P[A] {
  type CC[X] = P[X]
  def f(p: A => Boolean): M[CC]
}

trait Other {
  def g[A](p: A => Boolean): P[A] => M[P] = _ f p
}

It's a regression. It compiles in 2.9 and 2.10.0, freezes in 2.10.1 and 2.11.0-M7.

Here's the last gasp via -Ytyper-debug

|    |    |-- _root_.scala.Function1[A, Boolean] TYPEmode (site: value p in Other)
|    |    |    |-- Boolean TYPEmode (site: value p in Other)
|    |    |    |    \-> Boolean
|    |    |    \-> A => Boolean
|    |    |-- _root_.scala.Function1[P[A], M[P]] TYPEmode (site: method g in Other)
|    |    |    |-- P[A] TYPEmode (site: method g in Other)
|    |    |    |    \-> P[A]
|    |    |    |-- M[F] TYPEmode (site: method g in Other)
|    |    |    |    \-> M[P]
|    |    |    \-> P[A] => M[P]
|    |    |-- ((x$1) => x$1.f(p)) : pt=P[A] => M[P] EXPRmode (site: method g in Other)
|    |    |    |-- x$1.f(p) : pt=M[P] EXPRmode (site: value $anonfun in Other)
|    |    |    |    |-- x$1.f BYVALmode-EXPRmode-FUNmode-POLYmode (silent: value $anonfun in Other)
|    |    |    |    |    |-- x$1 EXPRmode-POLYmode-QUALmode (silent: value $anonfun in Other)
|    |    |    |    |    |    \-> x$1.type (with underlying type P[A])
|    |    |    |    |    \-> (p: A => Boolean)M[x$1.CC]
|    |    |    |    |-- p : pt=A => Boolean BYVALmode-EXPRmode (silent: value $anonfun in Other)
|    |    |    |    |    \-> A => Boolean
|    |    |    |    \-> M[x$1.CC]
@scabug
Copy link
Author

@scabug scabug commented Dec 10, 2013

Imported From: https://issues.scala-lang.org/browse/SI-8060?orig=1
Reporter: @paulp
Affected Versions: 2.10.1, 2.11.0-M7

@scabug
Copy link
Author

@scabug scabug commented Dec 10, 2013

@retronym said:
Will try to squeeze this into 2.10.4

scala/scala#3251

@scabug scabug closed this Dec 10, 2013
@scabug scabug added this to the 2.10.4-RC1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants