aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 385f913..2e6325e 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -9392,6 +9392,16 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl)
type = GET_SKIP_TYPE (resolved);
resolve_and_layout (type, NULL_TREE);
+
+ if (JPRIMITIVE_TYPE_P (type))
+ {
+ parse_error_context
+ (identifier_wfl,
+ "Can't invoke a method on primitive type `%s'",
+ IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))));
+ PATCH_METHOD_RETURN_ERROR ();
+ }
+
list = lookup_method_invoke (0, identifier_wfl, type, identifier, args);
args = nreverse (args);