- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Should -Xelide-below work with separate compilation?
Tue, 2011-05-17, 16:34
It seems that if you use -Xelide-below only in a dependency @elidable
methods are deleted from the bytecodes but are still accessible from
Scala code in a dependent project. This produces NoSuchMethodErrors at
runtime. Is that reasonable? Should I produce a test case and file a
bug?
On 5/17/11 8:34 AM, Johannes Rudolph wrote:
> It seems that if you use -Xelide-below only in a dependency @elidable
> methods are deleted from the bytecodes but are still accessible from
> Scala code in a dependent project. This produces NoSuchMethodErrors at
> runtime. Is that reasonable? Should I produce a test case and file a
> bug?
Producing NoSuchMethodErrors is not reasonable, but I don't understand how -Xelide-below could cause that to happen. Or, upon looking, maybe I do.
The way it is intended to work is that it only touches the call site. Any call to an elidable method is replaced with () if the setting so dictates. When I wrote it I think that's what it did... but looking at it now I see it is responding only to the symbol, which means it will scoop up not only calls to the method but the method itself.
Definitely a bug. A ticket would be great. No test case needed.