aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2017-02-17 00:27:43 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2017-02-17 00:27:43 +0100
commitb7cede3c27e42351e72618c45fd5e960df0e0133 (patch)
tree768d5b7ff9de004717d3e2567341a35fe9622182
parent74603cd9d355353f5373deb167988c5eaf015346 (diff)
downloadlombok-b7cede3c27e42351e72618c45fd5e960df0e0133.tar.gz
lombok-b7cede3c27e42351e72618c45fd5e960df0e0133.tar.bz2
lombok-b7cede3c27e42351e72618c45fd5e960df0e0133.zip
Reproduced issue #1132 (javac only); self-ref generics doesn’t work in `@Builder` in javac.
-rw-r--r--test/transform/knownBroken/before/I1132RecursiveGenerics.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/transform/knownBroken/before/I1132RecursiveGenerics.java b/test/transform/knownBroken/before/I1132RecursiveGenerics.java
new file mode 100644
index 00000000..781886a7
--- /dev/null
+++ b/test/transform/knownBroken/before/I1132RecursiveGenerics.java
@@ -0,0 +1,19 @@
+// Compile with javac, it'll think the T in the generated build() method isn't type compatible.
+// Yet, when you take the delomboked output (which delombok will give, but with errors), THAT does compile.
+
+public class I1132RecursiveGenerics {
+ public static class Recursive<T extends Recursive<T>> {}
+ public static final class Rec extends Recursive<Rec> {}
+
+ @lombok.Builder(builderClassName = "MethodBuilder")
+ public static <T extends Recursive<T>> T create() {
+ return null;
+ }
+
+ public static void main(String[] args) {
+ final MethodBuilder<Rec> builder = I1132RecursiveGenerics.builder();
+ final Rec rec = builder.build();
+// final Rec rec = I1132RecursiveGenerics.<Rec>builder().build();
+ }
+}
+