Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345214 - CCE on multi-occurs field access
Summary: CCE on multi-occurs field access
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-05-09 18:23 EDT by Justin Spadea CLA
Modified: 2017-02-23 14:20 EST (History)
2 users (show)

See Also:


Attachments
Add check for MultiplyOccuringItemTypeBinding (1.98 KB, patch)
2011-07-20 13:40 EDT, Justin Spadea CLA
lasher: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Spadea CLA 2011-05-09 18:23:41 EDT
Try to compile the following:

program test
	function main()
		rec struct[2];
		a any = rec[1].c.c2;
	end
end

record struct
	10 c char(2)[2];
		20 c2 char(1)[2];
end



Get an exception:
java.lang.ClassCastException: org.eclipse.edt.mof.impl.EClassImpl incompatible with org.eclipse.edt.mof.egl.Type
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofExpression.visit(Egl2MofExpression.java:274)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.visit(Egl2Mof.java:1)
	at org.eclipse.edt.compiler.core.ast.FieldAccess.accept(FieldAccess.java:52)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofMember.addInitializers(Egl2MofMember.java:639)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.addInitializers(Egl2Mof.java:1)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofStatement.visit(Egl2MofStatement.java:134)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.visit(Egl2Mof.java:1)
	at org.eclipse.edt.compiler.core.ast.FunctionDataDeclaration.accept(FunctionDataDeclaration.java:76)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofPart.handleEndVisitPart(Egl2MofPart.java:414)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofPart.defaultHandleVisitPart(Egl2MofPart.java:333)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofPart.visit(Egl2MofPart.java:144)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.visit(Egl2Mof.java:1)
Comment 1 Justin Spadea CLA 2011-07-20 13:40:36 EDT
Created attachment 200029 [details]
Add check for MultiplyOccuringItemTypeBinding

Here's an attempt at a fix. It returns a value similar to array fields, but I don't know this code well enough to be confident in the fix.
Comment 2 Paul Harmon CLA 2011-09-13 14:30:35 EDT
I have fixed this (for now). It will likely require some rework when we support structured records and multi-occurs items in the future.
Comment 3 Justin Spadea CLA 2011-09-13 15:39:37 EDT
Verified