Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329989 - [EGL] Illegal assignment to variable 't'. Expected Template and found org.eclipse.epsilon.egl.EglTemplate
Summary: [EGL] Illegal assignment to variable 't'. Expected Template and found org.ecl...
Status: CLOSED FIXED
Alias: None
Product: Epsilon
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Dimitris Kolovos CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-11 07:29 EST by Louis Rose CLA
Modified: 2012-02-06 10:59 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Louis Rose CLA 2010-11-11 07:29:53 EST
When invoking EGL from Java, assignments to a template variable fail with the following error:

Illegal assignment to variable 't'. Expected Template and found org.eclipse.epsilon.egl.EglTemplate


Exemplar client code:

	public static void main(String[] args) {
		EglTemplateFactory tf = new EglTemplateFactory();
		EglTemplate template = null;
		try {
			File f = FileUtil.getFile("absolute.egl", Runner.class);
			template = tf.load(f);
		} catch (Exception e) {
			e.printStackTrace();
		}
		try {
			String output = template.process();
			System.out.println(output);
		} catch (EolRuntimeException r) {
			r.printStackTrace();
		}
	}

Contents of EGL template:

[%
var t : Template := TemplateFactory.load('file:///Users/louis/Code/eclipse/workspaces/helios/epsilon-user/egl.problem/src/problem/simple.egl');
%]

[%=t.process()%]
Comment 1 Louis Rose CLA 2010-11-11 07:31:08 EST
This is a bug, caused by EglComplexType mandating that Template variables are of type EglFileGeneratingTemplate. I've changed EglComplexType to type-check Template variables against EglTemplate instead.
Comment 2 Louis Rose CLA 2010-11-12 05:13:53 EST
I've checked a fix into SVN. Assigning to Dimitris for build integration - thanks!
Comment 3 Dimitris Kolovos CLA 2010-11-25 08:10:03 EST
Fixed in 0.9.0.