Bug 227527 - [1.5][compiler] Useless error message for local enum
Summary: [1.5][compiler] Useless error message for local enum
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M3   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-17 07:28 EDT by David Audel CLA
Modified: 2008-10-27 08:05 EDT (History)
0 users

See Also:


Attachments
Proposed patch with testcase (6.25 KB, patch)
2008-09-12 14:27 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 David Audel CLA 2008-04-17 07:28:05 EDT
build I20080415-1646

public class X {
	void foo() {
		abstract enum E {
			
		}
	}
}

This test case produce the following error message:
'The member enum E cannot be local'

The error message catalog the following entry can be found:
752 = Illegal modifier for the local enum {0}; only abstract is permitted

This seems useless as enum cannot be local and cannot be abstract.
Comment 1 Kent Johnson CLA 2008-09-12 14:27:17 EDT
Created attachment 112454 [details]
Proposed patch with testcase

Removed the check in ClassScope that checked anonymous enum types since it was redundant

Extended EnumTest test003 with an anonymous type for an enum constant

Other existing tests show that errors for local enum types are reported correctly
Comment 2 Kent Johnson CLA 2008-10-03 12:20:27 EDT
Fix and test released for 3.5M3
Comment 3 David Audel CLA 2008-10-27 08:05:40 EDT
Verified for 3.5M3 using I20081026-2000 build.