aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource
diff options
context:
space:
mode:
Diffstat (limited to 'test/transform/resource')
-rw-r--r--test/transform/resource/after-delombok/ValErrors.java8
-rw-r--r--test/transform/resource/after-delombok/ValWeirdTypes.java10
-rw-r--r--test/transform/resource/after-ecj/ValComplex.java1
-rw-r--r--test/transform/resource/after-ecj/ValErrors.java1
-rw-r--r--test/transform/resource/after-ecj/ValInFor.java1
-rw-r--r--test/transform/resource/after-ecj/ValLessSimple.java1
-rw-r--r--test/transform/resource/after-ecj/ValSimple.java1
-rw-r--r--test/transform/resource/after-ecj/ValWeirdTypes.java1
-rw-r--r--test/transform/resource/before/ValErrors.java8
-rw-r--r--test/transform/resource/before/ValWeirdTypes.java12
-rw-r--r--test/transform/resource/messages-delombok/ValErrors.java.messages4
-rw-r--r--test/transform/resource/messages-idempotent/ValErrors.java.messages1
12 files changed, 39 insertions, 10 deletions
diff --git a/test/transform/resource/after-delombok/ValErrors.java b/test/transform/resource/after-delombok/ValErrors.java
index 5ac785ab..770a7e95 100644
--- a/test/transform/resource/after-delombok/ValErrors.java
+++ b/test/transform/resource/after-delombok/ValErrors.java
@@ -1,8 +1,8 @@
public class ValErrors {
- public void nullType() {
- final val a = null;
- }
public void unresolvableExpression() {
- final val c = d;
+ final java.lang.Object c = d;
+ }
+ public void arrayInitializer() {
+ val e = {"foo", "bar"};
}
} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/ValWeirdTypes.java b/test/transform/resource/after-delombok/ValWeirdTypes.java
index 66212906..34beb80b 100644
--- a/test/transform/resource/after-delombok/ValWeirdTypes.java
+++ b/test/transform/resource/after-delombok/ValWeirdTypes.java
@@ -44,4 +44,14 @@ public class ValWeirdTypes<Z> {
final java.util.AbstractList<java.lang.String> d = c ? a : b;
java.util.RandomAccess confirm = c ? a : b;
}
+ public void nullType() {
+ final java.lang.Object nully = null;
+ }
+ public void testArrays() {
+ final int[] intArray = new int[]{1, 2, 3};
+ final java.lang.Object[][] multiDimArray = new Object[][]{{}};
+ final int[] copy = intArray;
+ final java.lang.Object[] single = multiDimArray[0];
+ final int singleInt = copy[0];
+ }
} \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/ValComplex.java b/test/transform/resource/after-ecj/ValComplex.java
new file mode 100644
index 00000000..cb06d3c1
--- /dev/null
+++ b/test/transform/resource/after-ecj/ValComplex.java
@@ -0,0 +1 @@
+//ignore \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/ValErrors.java b/test/transform/resource/after-ecj/ValErrors.java
new file mode 100644
index 00000000..cb06d3c1
--- /dev/null
+++ b/test/transform/resource/after-ecj/ValErrors.java
@@ -0,0 +1 @@
+//ignore \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/ValInFor.java b/test/transform/resource/after-ecj/ValInFor.java
new file mode 100644
index 00000000..cb06d3c1
--- /dev/null
+++ b/test/transform/resource/after-ecj/ValInFor.java
@@ -0,0 +1 @@
+//ignore \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/ValLessSimple.java b/test/transform/resource/after-ecj/ValLessSimple.java
new file mode 100644
index 00000000..cb06d3c1
--- /dev/null
+++ b/test/transform/resource/after-ecj/ValLessSimple.java
@@ -0,0 +1 @@
+//ignore \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/ValSimple.java b/test/transform/resource/after-ecj/ValSimple.java
new file mode 100644
index 00000000..cb06d3c1
--- /dev/null
+++ b/test/transform/resource/after-ecj/ValSimple.java
@@ -0,0 +1 @@
+//ignore \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/ValWeirdTypes.java b/test/transform/resource/after-ecj/ValWeirdTypes.java
new file mode 100644
index 00000000..cb06d3c1
--- /dev/null
+++ b/test/transform/resource/after-ecj/ValWeirdTypes.java
@@ -0,0 +1 @@
+//ignore \ No newline at end of file
diff --git a/test/transform/resource/before/ValErrors.java b/test/transform/resource/before/ValErrors.java
index 742bca6d..7c5c0a8b 100644
--- a/test/transform/resource/before/ValErrors.java
+++ b/test/transform/resource/before/ValErrors.java
@@ -1,9 +1,9 @@
public class ValErrors {
- public void nullType() {
- val a = null;
- }
-
public void unresolvableExpression() {
val c = d;
}
+
+ public void arrayInitializer() {
+ val e = { "foo", "bar"};
+ }
} \ No newline at end of file
diff --git a/test/transform/resource/before/ValWeirdTypes.java b/test/transform/resource/before/ValWeirdTypes.java
index 6f6eb9db..855fb91f 100644
--- a/test/transform/resource/before/ValWeirdTypes.java
+++ b/test/transform/resource/before/ValWeirdTypes.java
@@ -51,4 +51,16 @@ public class ValWeirdTypes<Z> {
val d = c ? a : b;
java.util.RandomAccess confirm = c ? a : b;
}
+
+ public void nullType() {
+ val nully = null;
+ }
+
+ public void testArrays() {
+ val intArray = new int[] {1, 2, 3};
+ val multiDimArray = new Object[][] {{}};
+ val copy = intArray;
+ val single = multiDimArray[0];
+ val singleInt = copy[0];
+ }
} \ No newline at end of file
diff --git a/test/transform/resource/messages-delombok/ValErrors.java.messages b/test/transform/resource/messages-delombok/ValErrors.java.messages
index feba6912..ca7baeab 100644
--- a/test/transform/resource/messages-delombok/ValErrors.java.messages
+++ b/test/transform/resource/messages-delombok/ValErrors.java.messages
@@ -1,2 +1,2 @@
-3:21 ERROR Cannot use 'val' here because initializer expression does not have a representable type: <nulltype>
-7:21 ERROR Cannot use 'val' here because initializer expression does not have a representable type: Type cannot be resolved
+3:21 ERROR Cannot use 'val' here because initializer expression does not have a representable type: Type cannot be resolved
+7:21 ERROR 'val' is not compatible with array initializer expressions. Use the full form (new int[] { ... } instead of just { ... })
diff --git a/test/transform/resource/messages-idempotent/ValErrors.java.messages b/test/transform/resource/messages-idempotent/ValErrors.java.messages
new file mode 100644
index 00000000..ebeee317
--- /dev/null
+++ b/test/transform/resource/messages-idempotent/ValErrors.java.messages
@@ -0,0 +1 @@
+6:21 ERROR 'val' is not compatible with array initializer expressions. Use the full form (new int[] { ... } instead of just { ... })