Browse Source

Bugfix: valueOf expression for events within interfaces does not work

Andreas Mülder 12 years ago
parent
commit
f264c840a6

+ 4 - 1
plugins/org.yakindu.sct.model.stext/src/org/yakindu/sct/model/stext/validation/TypeInferrer.xtend

@@ -209,7 +209,10 @@ class TypeInferrer implements org.yakindu.sct.model.stext.validation.ITypeInferr
 		return trueType.combine(falseType)
 	} 
 	def dispatch inferType(FeatureCall featureCall){
-		if(featureCall.feature instanceof Event /*ntDefinition*/ && !(featureCall.eContainer instanceof EventRaisingExpression)){
+		if(featureCall.feature instanceof Event /*ntDefinition*/ 
+			&& !(featureCall.eContainer instanceof EventRaisingExpression) 
+			&&!(featureCall.eContainer instanceof EventValueReferenceExpression)
+		){
 			return ts.boolean
 		}
 		if (featureCall.feature instanceof Feature) {

+ 10 - 2
plugins/org.yakindu.sct.model.stext/xtend-gen/org/yakindu/sct/model/stext/validation/TypeInferrer.java

@@ -346,13 +346,21 @@ public class TypeInferrer implements ITypeInferrer, ICacheableTypeAnalyzer {
   
   protected Type _inferType(final FeatureCall featureCall) {
     boolean _and = false;
+    boolean _and_1 = false;
     EObject _feature = featureCall.getFeature();
     if (!(_feature instanceof Event)) {
-      _and = false;
+      _and_1 = false;
     } else {
       EObject _eContainer = featureCall.eContainer();
       boolean _not = (!(_eContainer instanceof EventRaisingExpression));
-      _and = ((_feature instanceof Event) && _not);
+      _and_1 = ((_feature instanceof Event) && _not);
+    }
+    if (!_and_1) {
+      _and = false;
+    } else {
+      EObject _eContainer_1 = featureCall.eContainer();
+      boolean _not_1 = (!(_eContainer_1 instanceof EventValueReferenceExpression));
+      _and = (_and_1 && _not_1);
     }
     if (_and) {
       return this.ts.getBoolean();