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 fails with assertion when trait defines a closure over private[this] member #5508

Closed
scabug opened this issue Feb 20, 2012 · 8 comments

Comments

@scabug
Copy link

scabug commented Feb 20, 2012

There was strange assertion fail while compiling a project. I know scala very basic and don't sure if used construction is valid in language reference, but compiler should generate more sensible error output in my opinion.

I've attached example file with several sections. Clear ones are ok, commented make compiler fail

@scabug
Copy link
Author

scabug commented Feb 20, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5508?orig=1
Reporter: ayvango
Affected Versions: 2.9.1, 2.10.0
Attachments:

  • private.scala (created on Feb 20, 2012 12:44:24 AM UTC, 1253 bytes)

@scabug
Copy link
Author

scabug commented Feb 20, 2012

@paulp said:
Let me just say WHAT A GREAT TEST CASE. If everyone came up with such great test cases by now you'd be able to use the scala compiler to operate nuclear reactors in low earth orbit.

@scabug
Copy link
Author

scabug commented Feb 21, 2012

@adriaanm said:
simplified:

object Test {
  trait NestedTrait { // must be nested and a trait
    private[this] val _st : Int = 0 // must be private[this]
    val escape = { () => _st }
  }
}

@scabug
Copy link
Author

scabug commented Feb 21, 2012

@adriaanm said:
Paul, I can only assume your all-caps enthusiasm means you'd like to go nuclear on this one? If not, please reassign.

@scabug
Copy link
Author

scabug commented Mar 15, 2013

@adriaanm said:
Un-assigning to foster work stealing, as announced in https://groups.google.com/forum/?fromgroups=#!topic/scala-internals/o8WG4plpNkw

@scabug
Copy link
Author

scabug commented Jul 10, 2013

@adriaanm said:
Unassigning and rescheduling to M6 as previous deadline was missed.

@scabug
Copy link
Author

scabug commented Nov 27, 2013

@retronym said:
Here's an analysis and one solution:

https://github.com/retronym/scala/tree/ticket/5508

@scabug
Copy link
Author

scabug commented Nov 27, 2013

@retronym said:
scala/scala#3199

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

2 participants