Lines 181-189
Link Here
|
181 |
int count = 0; |
181 |
int count = 0; |
182 |
nextMember : for (int i = 0; i < size; i++) { |
182 |
nextMember : for (int i = 0; i < size; i++) { |
183 |
TypeDeclaration memberContext = referenceContext.memberTypes[i]; |
183 |
TypeDeclaration memberContext = referenceContext.memberTypes[i]; |
184 |
if (memberContext.kind() == IGenericType.INTERFACE_DECL) { |
184 |
switch(memberContext.kind()) { |
185 |
problemReporter().nestedClassCannotDeclareInterface(memberContext); |
185 |
case IGenericType.INTERFACE_DECL : |
186 |
continue nextMember; |
186 |
case IGenericType.ANNOTATION_TYPE_DECL : |
|
|
187 |
problemReporter().illegalLocalTypeDeclaration(memberContext); |
188 |
continue nextMember; |
187 |
} |
189 |
} |
188 |
ReferenceBinding type = localType; |
190 |
ReferenceBinding type = localType; |
189 |
// check that the member does not conflict with an enclosing type |
191 |
// check that the member does not conflict with an enclosing type |
Lines 232-243
Link Here
|
232 |
int count = 0; |
234 |
int count = 0; |
233 |
nextMember : for (int i = 0; i < length; i++) { |
235 |
nextMember : for (int i = 0; i < length; i++) { |
234 |
TypeDeclaration memberContext = referenceContext.memberTypes[i]; |
236 |
TypeDeclaration memberContext = referenceContext.memberTypes[i]; |
235 |
if (memberContext.kind() == IGenericType.INTERFACE_DECL |
237 |
switch(memberContext.kind()) { |
236 |
&& sourceType.isNestedType() |
238 |
case IGenericType.INTERFACE_DECL : |
237 |
&& sourceType.isClass() // no need to check for enum, since implicitly static |
239 |
case IGenericType.ANNOTATION_TYPE_DECL : |
238 |
&& !sourceType.isStatic()) { |
240 |
if (sourceType.isNestedType() |
239 |
problemReporter().nestedClassCannotDeclareInterface(memberContext); |
241 |
&& sourceType.isClass() // no need to check for enum, since implicitly static |
240 |
continue nextMember; |
242 |
&& !sourceType.isStatic()) { |
|
|
243 |
problemReporter().illegalLocalTypeDeclaration(memberContext); |
244 |
continue nextMember; |
245 |
} |
241 |
} |
246 |
} |
242 |
ReferenceBinding type = sourceType; |
247 |
ReferenceBinding type = sourceType; |
243 |
// check that the member does not conflict with an enclosing type |
248 |
// check that the member does not conflict with an enclosing type |