class Outer {final case class Inner(n: Int)}With 2.10.1-RC[12] it complains that "The outer reference in this type test cannot be checked at run time." What does that even mean? Is the warning something I should pay attention to and fix, or is it a regression?
Also, 2.10 has the warning as well, as soon as you try to match on it. What has changed apparently is that the warning is issued at the point of the class definition.
--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
as we don't an outer accessor for final nested classes for reasons unknown to me
--
Well I know the immediate reason: memory consumption. I don't know why we chose the *final* modifier to suppress this.
The warning refers to the synthesized equals method, which cannot test the outer pointer for Inner (as we don't an outer accessor for final nested classes for reasons unknown to me).
I just ran into this warning, and even though I read this thread a month ago, I had no idea on Earth what the warning could mean.On Saturday, March 2, 2013 2:27:54 AM UTC+1, Adriaan Moors wrote:
The warning refers to the synthesized equals method, which cannot test the outer pointer for Inner (as we don't an outer accessor for final nested classes for reasons unknown to me).But what about showing the user the code the warning is talking about? I know about -Xprint:typer, but that doesn't sound like a good solution.
In general, if a warning/error position refers to a synthetic code fragment, shouldn't we tell the user that the warning/error is in generated code, and at least point to -Xprint:typer if not show the generated code directly (which is not trivial to get right)?