diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2019-07-09 00:20:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-09 00:20:43 +0200 |
commit | 8b805fadf74499c7bbf1724cfe6fea9d485d4b87 (patch) | |
tree | 7f3d93fe1f6f346103e84441c2200237b9ad5d01 /test | |
parent | c1039553b088dc45d272b942d930414d3224b06c (diff) | |
parent | a899ffcbca7d7d9e3d616659d12a843fe02da6f6 (diff) | |
download | lombok-8b805fadf74499c7bbf1724cfe6fea9d485d4b87.tar.gz lombok-8b805fadf74499c7bbf1724cfe6fea9d485d4b87.tar.bz2 lombok-8b805fadf74499c7bbf1724cfe6fea9d485d4b87.zip |
Merge pull request #2138 from bulgakovalexander/feature/typeInferenceImprovements
val. override error handling policy for problemReporter to guarantee AbortCompilation is throwing.
Diffstat (limited to 'test')
7 files changed, 58 insertions, 6 deletions
diff --git a/test/transform/resource/after-delombok/ValInLambda.java b/test/transform/resource/after-delombok/ValInLambda.java index 7ce1e1b4..861fb9da 100644 --- a/test/transform/resource/after-delombok/ValInLambda.java +++ b/test/transform/resource/after-delombok/ValInLambda.java @@ -2,17 +2,26 @@ class ValInLambda { Runnable foo = (Runnable) () -> { final int i = 1; + final java.lang.Runnable foo = (System.currentTimeMillis() > 0) ? (Runnable) () -> { + } : System.out::println; }; - + public void easyLambda() { Runnable foo = (Runnable) () -> { final int i = 1; }; } - + public void easyIntersectionLambda() { Runnable foo = (Runnable) () -> { final int i = 1; }; } + + public void easyLubLambda() { + Runnable foo = (Runnable) () -> { + final java.lang.Runnable fooInner = (System.currentTimeMillis() > 0) ? (Runnable) () -> { + } : System.out::println; + }; + } } diff --git a/test/transform/resource/after-delombok/ValLambda.java b/test/transform/resource/after-delombok/ValLambda.java index 00ff27ad..24ae3b5f 100644 --- a/test/transform/resource/after-delombok/ValLambda.java +++ b/test/transform/resource/after-delombok/ValLambda.java @@ -1,15 +1,27 @@ // version 8: class ValLambda { + static { + final java.lang.Runnable foo = (System.currentTimeMillis() > 0) ? (Runnable) () -> { + } : System.out::println; + } + + { + final java.lang.Runnable foo = (System.currentTimeMillis() > 0) ? (Runnable) () -> { + } : System.out::println; + } + public void easyLambda() { final java.lang.Runnable foo = (Runnable) () -> { }; } + public void easyIntersectionLambda() { final java.lang.Runnable foo = (Runnable & java.io.Serializable) () -> { }; final java.io.Serializable bar = (java.io.Serializable & Runnable) () -> { }; } + public void easyLubLambda() { final java.lang.Runnable foo = (System.currentTimeMillis() > 0) ? (Runnable) () -> { } : System.out::println; diff --git a/test/transform/resource/after-ecj/ValInLambda.java b/test/transform/resource/after-ecj/ValInLambda.java index 7669789b..0fac61e9 100644 --- a/test/transform/resource/after-ecj/ValInLambda.java +++ b/test/transform/resource/after-ecj/ValInLambda.java @@ -1,9 +1,9 @@ -// version 8: - import lombok.val; class ValInLambda { Runnable foo = (Runnable) () -> { final @val int i = 1; + final @lombok.val java.lang.Runnable foo = ((System.currentTimeMillis() > 0) ? (Runnable) () -> { +} : System.out::println); }; ValInLambda() { super(); @@ -18,4 +18,10 @@ class ValInLambda { final @val int i = 1; }; } + public void easyLubLambda() { + Runnable foo = (Runnable) () -> { + final @lombok.val java.lang.Runnable fooInner = ((System.currentTimeMillis() > 0) ? (Runnable) () -> { +} : System.out::println); +}; + } } diff --git a/test/transform/resource/after-ecj/ValLambda.java b/test/transform/resource/after-ecj/ValLambda.java index fcb855b3..5b52869f 100644 --- a/test/transform/resource/after-ecj/ValLambda.java +++ b/test/transform/resource/after-ecj/ValLambda.java @@ -1,4 +1,14 @@ class ValLambda { + static { + final @lombok.val java.lang.Runnable foo = ((System.currentTimeMillis() > 0) ? (Runnable) () -> { +} : System.out::println); + } + { + final @lombok.val java.lang.Runnable foo = ((System.currentTimeMillis() > 0) ? (Runnable) () -> { +} : System.out::println); + } + <clinit>() { + } ValLambda() { super(); } diff --git a/test/transform/resource/before/ValInLambda.java b/test/transform/resource/before/ValInLambda.java index 2c2a5942..a5364f8e 100644 --- a/test/transform/resource/before/ValInLambda.java +++ b/test/transform/resource/before/ValInLambda.java @@ -5,6 +5,7 @@ import lombok.val; class ValInLambda { Runnable foo = (Runnable) () -> { val i = 1; + lombok.val foo = (System.currentTimeMillis() > 0) ? (Runnable)()-> {} : System.out::println; }; public void easyLambda() { @@ -18,4 +19,10 @@ class ValInLambda { val i = 1; }; } + + public void easyLubLambda() { + Runnable foo = (Runnable) () -> { + lombok.val fooInner = (System.currentTimeMillis() > 0) ? (Runnable)()-> {} : System.out::println; + }; + } } diff --git a/test/transform/resource/before/ValLambda.java b/test/transform/resource/before/ValLambda.java index 35f83c3c..5c9c4a43 100644 --- a/test/transform/resource/before/ValLambda.java +++ b/test/transform/resource/before/ValLambda.java @@ -1,5 +1,13 @@ // version 8: class ValLambda { + + static { + lombok.val foo = (System.currentTimeMillis() > 0) ? (Runnable)()-> {} : System.out::println; + } + { + lombok.val foo = (System.currentTimeMillis() > 0) ? (Runnable)()-> {} : System.out::println; + } + public void easyLambda() { lombok.val foo = (Runnable)()-> {}; } diff --git a/test/transform/resource/messages-ecj/ValLambda.java.messages b/test/transform/resource/messages-ecj/ValLambda.java.messages index 21c831c3..e6940434 100644 --- a/test/transform/resource/messages-ecj/ValLambda.java.messages +++ b/test/transform/resource/messages-ecj/ValLambda.java.messages @@ -1,2 +1,2 @@ -14 Function is a raw type. References to generic type Function<T,R> should be parameterized -15 Function is a raw type. References to generic type Function<T,R> should be parameterized
\ No newline at end of file +23 Function is a raw type. References to generic type Function<T,R> should be parameterized +24 Function is a raw type. References to generic type Function<T,R> should be parameterized
\ No newline at end of file |