Bug 200016 - [1.5][compiler] better error message when enum constants must implement methods
Summary: [1.5][compiler] better error message when enum constants must implement methods
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.4 M3   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 102590
  Show dependency tree
 
Reported: 2007-08-15 06:36 EDT by Martin Aeschlimann CLA
Modified: 2007-10-29 05:17 EDT (History)
2 users (show)

See Also:


Attachments
Proposed patch (14.87 KB, patch)
2007-10-12 13:30 EDT, Kent Johnson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2007-08-15 06:36:08 EDT
3.4

In the following code, the enum constants need to implement 'foo'.  Currently the error is on 'foo': 
'The enum TestEnum can only define the abstract method foo() if it also defines enum constants with corresponding implementations'

enum TestEnum {
	test1,
	test2;
	public abstract boolean foo();
}

I think it would make more sense to report this on the constants directly, like it is done for types that need to implement methods:
'The enum constant test1 must implement the abstract method foo()'.

Especially if some constants implement 'foo' already it would be more natural to get the error on the constant (also better for the quick fix)
Comment 1 Philipe Mulet CLA 2007-10-10 05:20:26 EDT
agreed
Comment 2 Kent Johnson CLA 2007-10-12 13:30:13 EDT
Created attachment 80252 [details]
Proposed patch

This patch takes care of this bug and bug 200026
Comment 3 Kent Johnson CLA 2007-10-12 13:30:50 EDT
Released into HEAD for 3.4M3
Comment 4 Frederic Fusier CLA 2007-10-29 05:17:23 EDT
Verified for 3.4M3 using I20071029-0010 build.