Skip to content

local lazy val containing case class fails to compile, issue with TreeTypeMap #1810

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

Closed
smarter opened this issue Dec 15, 2016 · 2 comments
Closed

Comments

@smarter
Copy link
Member

smarter commented Dec 15, 2016

I was asked to provide an example of TreeTypeMap being broken in some other phase than ElimByName, so here you go :).

class Test {
  def test: Unit = {
    lazy val x: Int = {
      case class Foo(x: Int)
      1
    }
  }
}

Fails with the mysterious:

constructor throws in class throws does not take type parameters

Stack trace after using -Xprompt: https://gist.github.com/d121067571cdcbf9bac26cf8028f6002

@smarter smarter changed the title local lazy val containing case class fails to compile local lazy val containing case class fails to compile, issue with TreeTypeMap Dec 15, 2016
@DarkDimius
Copy link
Contributor

I'm Digging into this.

@DarkDimius
Copy link
Contributor

Fixed in #1811.

odersky added a commit that referenced this issue Dec 16, 2016
Fix #1810 LazyVals should use changeOwnerAfter.
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

3 participants