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 crashes trying to infer Bar[A] from Option[Bar[_ >: A]] #9788

Closed
scabug opened this issue May 20, 2016 · 3 comments
Closed

compiler crashes trying to infer Bar[A] from Option[Bar[_ >: A]] #9788

scabug opened this issue May 20, 2016 · 3 comments

Comments

@scabug
Copy link

scabug commented May 20, 2016

object crash {

  class Bar[A]

  def bar[A](barOpt: Option[Bar[_ >: A]]): Bar[A] = new Bar

  def build[A](barOpt: Option[Bar[_ >: A]]): Bar[A] =
    // fix the crash by inserting "[A]" on the following line                                                      
    bar(barOpt)

}

I put the error message and stack trace in gist here: https://gist.github.com/sullivan-/5e591458f3338ebf4be626cb5a8e91be

@scabug
Copy link
Author

scabug commented May 20, 2016

Imported From: https://issues.scala-lang.org/browse/SI-9788?orig=1
Reporter: john sullivan (sullivan)
Affected Versions: 2.10.6, 2.11.7, 2.12.0-M3
See #5559

@scabug
Copy link
Author

scabug commented May 20, 2016

john sullivan (sullivan) said:
Just to note, the problem goes away if I change the parameter type from Option[Bar[_ >: A]] to any of the following:

  • Bar[_ >: A]
  • Option[Bar[_]]
  • Option[Bar[A]]

@scabug
Copy link
Author

scabug commented Aug 4, 2016

@SethTisue said:
looks like a dupe of #5559 (thanks though for the nicely minimized repro code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant