Bug 526338 - Cryptic compile error message when "uses" has no "with"
Summary: Cryptic compile error message when "uses" has no "with"
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.7.1a   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-21 10:47 EDT by Dani Megert CLA
Modified: 2022-12-10 12:45 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2017-10-21 10:47:53 EDT
Adding
provides <a class>; gives a cryptic compile error:

"Syntax error on token "provides", requires expected"

I would expect that it tells me that "with" is missing. Check what javac "says".

Test Case:
provides Object;
Comment 1 Dani Megert CLA 2017-10-21 10:48:16 EDT
Should be fixed in 4.7.2 or 4.7.3.
Comment 2 Stephan Herrmann CLA 2017-10-21 10:56:20 EDT
In the presence of restricted keywords, I'm not sure we have the means to influence syntax error messages a lot. Legally, we didn't see a keyword "provides", because we could not successfully parse a module declaration, so *all* restricted keywords are in fact identifiers in this file. Just saying.

Still one option we could try: add parser rules for all incomplete variants of module directives and let Parser explicitly raise hand crafted syntax error messages.
Comment 3 Manoj N Palat CLA 2018-05-16 01:38:52 EDT
Bulk move out of 4.8
Comment 4 Eclipse Genie CLA 2020-09-23 14:40:34 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Eclipse Genie CLA 2022-12-10 12:45:44 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.