aboutsummaryrefslogtreecommitdiff
path: root/javatests
diff options
context:
space:
mode:
authorcushon <cushon@google.com>2018-05-24 14:31:35 -0700
committerLiam Miller-Cushon <cushon@google.com>2018-06-12 19:44:48 -0700
commit45f1a55053d6958dcf6b781a98c0a08bb0cf35f9 (patch)
tree909101fc418bff3e338ed06026de23fb99cf92bb /javatests
parent64e445733351379f7eba2b37fd34c116cc856dd1 (diff)
downloadturbine-45f1a55053d6958dcf6b781a98c0a08bb0cf35f9.tar.gz
Improve diagnostics for unresolvable fields inside constant expressions
MOE_MIGRATED_REVID=197954529
Diffstat (limited to 'javatests')
-rw-r--r--javatests/com/google/turbine/binder/BinderErrorTest.java32
1 files changed, 31 insertions, 1 deletions
diff --git a/javatests/com/google/turbine/binder/BinderErrorTest.java b/javatests/com/google/turbine/binder/BinderErrorTest.java
index 20114e2..0f37537 100644
--- a/javatests/com/google/turbine/binder/BinderErrorTest.java
+++ b/javatests/com/google/turbine/binder/BinderErrorTest.java
@@ -301,7 +301,7 @@ public class BinderErrorTest {
"}",
},
{
- "<>:5: error: could not evaluate constant expression", //
+ "<>:5: error: could not resolve field NO_SUCH", //
" @Anno(value=Test.NO_SUCH) int x;",
" ^",
},
@@ -373,6 +373,36 @@ public class BinderErrorTest {
" ^",
},
},
+ {
+ {
+ "public class Test {", //
+ " @interface Anno {",
+ " Class<?>[] value() default Object.class;",
+ " }",
+ " @Anno(value={java.util.Map.Entry}) int x;",
+ "}",
+ },
+ {
+ "<>:5: error: could not resolve field Entry", //
+ " @Anno(value={java.util.Map.Entry}) int x;",
+ " ^",
+ },
+ },
+ {
+ {
+ "public class Test {", //
+ " @interface Anno {",
+ " Class<?>[] value() default Object.class;",
+ " }",
+ " @Anno(value={java.lang.Object}) int x;",
+ "}",
+ },
+ {
+ "<>:5: error: could not resolve field Object", //
+ " @Anno(value={java.lang.Object}) int x;",
+ " ^",
+ },
+ },
};
return Arrays.asList((Object[][]) testCases);
}