Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.emf.ecore.xcore/src/org')
-rw-r--r--org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/generator/XcoreGenerator.xtend2
1 files changed, 2 insertions, 0 deletions
diff --git a/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/generator/XcoreGenerator.xtend b/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/generator/XcoreGenerator.xtend
index 3307fb106..81c406e12 100644
--- a/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/generator/XcoreGenerator.xtend
+++ b/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/generator/XcoreGenerator.xtend
@@ -21,6 +21,7 @@ import org.eclipse.emf.codegen.ecore.generator.Generator
import org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter
import org.eclipse.emf.common.util.BasicMonitor
import org.eclipse.emf.ecore.xcore.mappings.XcoreMapper
+import org.eclipse.xtext.common.types.JvmOperation
class XcoreGenerator implements IGenerator {
@@ -36,6 +37,7 @@ class XcoreGenerator implements IGenerator {
for (op : pack.allContentsIterable.filter(typeof(XOperation))) {
val eOperation = op.mapping.EOperation
val appendable = new StringBuilderBasedAppendable()
+ appendable.declareVariable(mappings.getMapping(op).jvmOperation.declaringType,"this");
// val expectedType = op.jvmOperation.returnType
compiler.compile(op.body, appendable, null)
eOperation.EAnnotations.add(createGenModelAnnotation("body", appendable.toString))

Back to the top