Open GoogleCodeExporter opened 9 years ago
Thanks for finding this; we call attribution for @ExtensionMethod and a few
other things; this adds implicit super() calls all over the place (it's hard to
find out which source is exactly affected, unfortunately, it's not just the
code we attribute, it also happens to code referenced by the code we
attribute). We thought it didn't matter much (other than generate extra lines
in delombok, where we just remove all super() calls), but it turns out it
matters here.
Fixing this is going to be extremely difficult, unfortunately. Awesome find,
though :)
NB: For future volunteers: The key aspects are @ExtensionMethod, a 'complex'
enum value (with its own block; attributing this vardecl is what generates the
superfluous super() call), and at least 1 method call, to anything, in that
block, to trigger attribution to check if @ExtensionMethod needs to go to work.
It doesn't have to be an actual extensionmethod call, even
System.out.println(); will do.
Original comment by reini...@gmail.com
on 10 Oct 2013 at 9:03
Thanks for you reply
Original comment by jrdalpra
on 11 Oct 2013 at 12:19
This looks suspiciously much like issue 276.
Original comment by askon...@gmail.com
on 11 Nov 2013 at 10:35
Hello,
I got the same compilation error without using the @ExtensionMethod annotation.
I stripped down to implementation to the following code where the combination
of overriding an abstract member function and usage of 'val' within this
function seems to trigger the error.
lombok version: 0.12.0
javac version: 1.6.0_35
import lombok.val;
public enum MyEnum {
VAL1("title1") {
@Override
public String getValue() {
// usage of 'val' here causes the compilation error
val s = "value1";
return s;
}
};
private final String title;
private MyEnum(String title)
{
this.title = title;
}
public abstract String getValue();
}
Btw. - many thanks to the lombok project - it's really great!
Original comment by tom1...@gmail.com
on 5 Jan 2014 at 9:26
Original issue reported on code.google.com by
jrdalpra
on 8 Oct 2013 at 8:34