Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366095 - An Annotation which has a field of annotations produces a compile an error
Summary: An Annotation which has a field of annotations produces a compile an error
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-08 14:30 EST by Joseph Vincens CLA
Modified: 2017-02-23 14:18 EST (History)
1 user (show)

See Also:


Attachments
jtopen annotations (24.00 KB, application/unknown)
2011-12-08 14:34 EST, Joseph Vincens CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Vincens CLA 2011-12-08 14:30:55 EST
I will attach a project that exhibits the problem.
Comment 1 Joseph Vincens CLA 2011-12-08 14:34:51 EST
Created attachment 208114 [details]
jtopen annotations

In the attached there is a service services.S1 that uses the annotation IBMiProgram, this annotation has a field parameterAnnotations which can be any of the eglx.jtopen.annotations.AS400xxxx annotations. 
if parameterAnnotations contains all the same type I get no error if it contains different types (like the example in S1) I see:
 AS400Bin2 and AS400Bin4 are not compatible types in the expression [AS400Bin2, ..., AS400Bin4].
Comment 2 Joseph Vincens CLA 2011-12-08 15:47:59 EST
I came up with a workaround so this is no longer blocking me.
I found that by wrapping each annotation in the same type I'm able to create the array.

so instead of
		parameterAnnotations = [
			@AS400Bin2{},
			@AS400Bin4{}
		]
I do 
		parameterAnnotations = [
			@AS400Parameter{annotation = @AS400Bin2{}},
			@AS400Parameter{annotation = @AS400Bin4{}}
		]
I still can't use a null as an array element, but at least I can continue.

Record AS400Parameter type Annotation
{	targets=[ElementKind.FieldMbr]
}
	annotation any?;
end
Comment 3 Paul Harmon CLA 2011-12-09 13:34:45 EST
I have committed a change to the following classes:

TypeCompatibilityUtil
SeeingsBlockAnnotationBindingBindingsCompletor
Comment 4 Joseph Vincens CLA 2011-12-12 08:36:15 EST
fixed