aboutsummaryrefslogtreecommitdiff
path: root/test/transform
diff options
context:
space:
mode:
authorBulgakov Alexander <buls@yandex.ru>2019-04-24 14:06:15 +0300
committerBulgakov Alexander <buls@yandex.ru>2019-04-24 14:06:15 +0300
commitf0343886a331f3cb2175545a062f3736610f9179 (patch)
treec4699c4be71abc13d6185ffe21f363f18dff6267 /test/transform
parent69e6932b81f9e6e17da3097ac6e576a261d3e4c1 (diff)
downloadlombok-f0343886a331f3cb2175545a062f3736610f9179.tar.gz
lombok-f0343886a331f3cb2175545a062f3736610f9179.tar.bz2
lombok-f0343886a331f3cb2175545a062f3736610f9179.zip
improvements type inference of type intersections (affects ValLambda.java, ValWeirdTypes.java tests)
Diffstat (limited to 'test/transform')
-rw-r--r--test/transform/resource/after-delombok/ValLambda.java4
-rw-r--r--test/transform/resource/after-delombok/ValWeirdTypes.java10
-rw-r--r--test/transform/resource/after-ecj/ValLambda.java4
-rw-r--r--test/transform/resource/after-ecj/ValWeirdTypes.java10
-rw-r--r--test/transform/resource/before/ValWeirdTypes.java8
5 files changed, 28 insertions, 8 deletions
diff --git a/test/transform/resource/after-delombok/ValLambda.java b/test/transform/resource/after-delombok/ValLambda.java
index 9214b490..60aeaac9 100644
--- a/test/transform/resource/after-delombok/ValLambda.java
+++ b/test/transform/resource/after-delombok/ValLambda.java
@@ -5,9 +5,9 @@ class ValLambda {
};
}
public void easyIntersectionLambda() {
- final java.lang.Object foo = (Runnable & java.io.Serializable) () -> {
+ final java.lang.Runnable foo = (Runnable & java.io.Serializable) () -> {
};
- final java.lang.Object bar = (java.io.Serializable & Runnable) () -> {
+ final java.io.Serializable bar = (java.io.Serializable & Runnable) () -> {
};
}
public void easyLubLambda() {
diff --git a/test/transform/resource/after-delombok/ValWeirdTypes.java b/test/transform/resource/after-delombok/ValWeirdTypes.java
index a6bc9bd4..8b399fe8 100644
--- a/test/transform/resource/after-delombok/ValWeirdTypes.java
+++ b/test/transform/resource/after-delombok/ValWeirdTypes.java
@@ -56,8 +56,14 @@ public class ValWeirdTypes<Z> {
final int singleInt = copy[0];
}
public void arraysAsList() {
- final java.util.List<java.lang.Class<? extends java.lang.Object>> x = Arrays.asList(String.class, BigDecimal.class);
- for (final java.lang.Class<?> y : x) {
+ final java.util.List<java.lang.Class<? extends java.io.Serializable>> x = Arrays.asList(String.class, BigDecimal.class);
+ for (final java.lang.Class<? extends java.io.Serializable> y : x) {
+ }
+ }
+ @SuppressWarnings("all")
+ public void arraysAsList2() {
+ final java.util.List<java.lang.Class<? extends java.lang.Comparable>> x = Arrays.asList(String.class, BigDecimal.class, Comparable.class);
+ for (final java.lang.Class<? extends java.lang.Comparable> y : x) {
}
}
}
diff --git a/test/transform/resource/after-ecj/ValLambda.java b/test/transform/resource/after-ecj/ValLambda.java
index 4bf3265b..4e2b97a1 100644
--- a/test/transform/resource/after-ecj/ValLambda.java
+++ b/test/transform/resource/after-ecj/ValLambda.java
@@ -7,9 +7,9 @@ class ValLambda {
};
}
public void easyIntersectionLambda() {
- final @lombok.val java.lang.Object foo = (Runnable & java.io.Serializable) () -> {
+ final @lombok.val java.lang.Runnable foo = (Runnable & java.io.Serializable) () -> {
};
- final @lombok.val java.lang.Object bar = (java.io.Serializable & Runnable) () -> {
+ final @lombok.val java.io.Serializable bar = (java.io.Serializable & Runnable) () -> {
};
}
public void easyLubLambda() {
diff --git a/test/transform/resource/after-ecj/ValWeirdTypes.java b/test/transform/resource/after-ecj/ValWeirdTypes.java
index 9f448db9..e98b9753 100644
--- a/test/transform/resource/after-ecj/ValWeirdTypes.java
+++ b/test/transform/resource/after-ecj/ValWeirdTypes.java
@@ -63,8 +63,14 @@ public class ValWeirdTypes<Z> {
final @val int singleInt = copy[0];
}
public void arraysAsList() {
- final @val java.util.List<java.lang.Class<? extends java.lang.Object>> x = Arrays.asList(String.class, BigDecimal.class);
- for (final @val java.lang.Class<? extends java.lang.Object> y : x)
+ final @val java.util.List<java.lang.Class<? extends java.io.Serializable>> x = Arrays.asList(String.class, BigDecimal.class);
+ for (final @val java.lang.Class<? extends java.io.Serializable> y : x)
+ {
+ }
+ }
+ public @SuppressWarnings("all") void arraysAsList2() {
+ final @val java.util.List<java.lang.Class<? extends java.lang.Comparable>> x = Arrays.asList(String.class, BigDecimal.class, Comparable.class);
+ for (final @val java.lang.Class<? extends java.lang.Comparable> y : x)
{
}
}
diff --git a/test/transform/resource/before/ValWeirdTypes.java b/test/transform/resource/before/ValWeirdTypes.java
index 4ea1b5d4..157ffc76 100644
--- a/test/transform/resource/before/ValWeirdTypes.java
+++ b/test/transform/resource/before/ValWeirdTypes.java
@@ -72,4 +72,12 @@ public class ValWeirdTypes<Z> {
}
}
+
+ @SuppressWarnings("all")
+ public void arraysAsList2() {
+ val x = Arrays.asList(String.class, BigDecimal.class, Comparable.class);
+ for (val y : x) {
+
+ }
+ }
} \ No newline at end of file