diff options
author | Rawi01 <Rawi01@users.noreply.github.com> | 2020-11-19 17:36:40 +0100 |
---|---|---|
committer | Rawi01 <Rawi01@users.noreply.github.com> | 2020-11-25 08:54:17 +0100 |
commit | db80bb0a2168245dbae2e1ec565a830e92a7c684 (patch) | |
tree | bb4156e1294595b017d1f060551dbb7d307c32c2 /test/transform/resource/before/ExtensionMethodGeneric.java | |
parent | e1f82ac4d132769cfc272dccfc916aeba7181718 (diff) | |
download | lombok-db80bb0a2168245dbae2e1ec565a830e92a7c684.tar.gz lombok-db80bb0a2168245dbae2e1ec565a830e92a7c684.tar.bz2 lombok-db80bb0a2168245dbae2e1ec565a830e92a7c684.zip |
[fixes #2648] Reset inference context, remove generic information copy
In Java >= 8 ecj uses the inference context to resolve the generic
information. This one is already set before lombok tries rewrite the
method call. Simply copying the information does not cover all the
different cases but reseting the inference contexts and running type
inference again does.
Diffstat (limited to 'test/transform/resource/before/ExtensionMethodGeneric.java')
-rw-r--r-- | test/transform/resource/before/ExtensionMethodGeneric.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/transform/resource/before/ExtensionMethodGeneric.java b/test/transform/resource/before/ExtensionMethodGeneric.java new file mode 100644 index 00000000..d44c663b --- /dev/null +++ b/test/transform/resource/before/ExtensionMethodGeneric.java @@ -0,0 +1,34 @@ +import java.util.List; +import java.util.Map; + +import lombok.experimental.ExtensionMethod; + +@ExtensionMethod(ExtensionMethodGeneric.Extensions.class) +class ExtensionMethodGeneric { + public void test() { + List<String> stringList = null; + List<Number> numberList = null; + stringList.test(); + stringList.test(numberList); + stringList.test(stringList).test(numberList); + Integer i = stringList.test2(); + + Map<String, Integer> map = null; + List<String> l = map.test(stringList, numberList); + } + + static class Extensions { + public static <T> List<T> test(List<String> obj, List<T> list) { + return null; + } + public static <K,V> K test(Map<String, Integer> obj, K k, V v) { + return k; + } + public static <T> T test(List<T> list) { + return null; + } + public static <T,U> U test2(List<T> list) { + return null; + } + } +} |