-
Notifications
You must be signed in to change notification settings - Fork 21
AssertionError in scalac when compiling a case class with -Ytyper-debug enabled #12675
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
Comments
Since 2.12.7. Edit: 2.12.7 includes 2.13.0-RC1 backports. |
By finicky, I mean duplicates #12601 which is the same stack trace, but I don't remember the disposition, so let's leave this open until there is some clarity. |
I don't want to appear entitled, but would it be possible to catch errors in the compiler and provide additional information For example, I personally use something like:
It's not a huge effert to pepper the code with such rethrows, at least in places liable to cause problems - |
By "larger refactor", I guess you mean that you refactor your code and the (maybe buggy compiler) symptom changes so it's hard to know how to get your code to compile nicely again? For error context there is https://github.com/scala/scala/blob/2.13.x/src/compiler/scala/tools/nsc/Global.scala#L1080 It doesn't always know when to discard error context as it tries a series of adaptations, for example. (Also, not an expert.) |
I feel really stupid, as I see I actually reported it previously myself and have no recollection of it. I don't know why it didn't show in my search with a stack trace element? I swear I started with it in hope that maybe there is some info on it. I must have searched with the default And yes, especially things like adding/removing a type parameter to a whole class hierarchy are risky in my experience. |
That seems totally normal to me. Possibly, I mean "normalized". I wonder if there are certain refactorings that play havoc with incremental compilation. I think On context, there have been efforts around typing, but less around crashing cleanly. Maybe Scala 4 will be the compiler with opinionated crashes. |
About improving error reporting when the compiler crashes: fwiw, we're trying to improve that in Scala 3 over at scala/scala3#16593 . It's an area where pull requests remain welcome in Scala 2 as well. |
So, should this one stay open or not? I'm confused by the history here. |
The linked ticket had 2 cases: the NPE was transferred to zinc; the assert duplicated this ticket. I vote leave open for either fix the assertion or improve the crash output. |
Reproduction steps
Scala version: 2.13.10
Problem
When compiling with
-Ytyper-debug
:The text was updated successfully, but these errors were encountered: