Просмотр исходного кода

added VOID as valid Type, Interpreter only calls for defaultValue if Type != null

bohl@itemis.de 11 лет назад
Родитель
Сommit
03a51ee50c

+ 1 - 1
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.xtend

@@ -494,7 +494,7 @@ class SequenceBuilder {
 		if (vd.initialValue != null) {
 			return vd.initialValue
 		} else {
-			return vd.type.defaultValue.buildValue
+			return vd.type?.defaultValue.buildValue
 		}
 	}
 

+ 3 - 3
plugins/org.yakindu.sct.simulation.core.sexec/src/org/yakindu/sct/simulation/core/sexec/container/DefaultExecutionContextInitializer.xtend

@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2013 committers of YAKINDU and others.
+ * Copyright (c) 2015 committers of YAKINDU and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -115,7 +115,7 @@ class DefaultExecutionContextInitializer implements IExecutionContextInitializer
 		it.name = variable.fullyQualifiedName.lastSegment
 		it.fqName = variable.fullyQualifiedName.toString
 		it.type = variable.inferType(null)
-		it.value = it.type.defaultValue
+		it.value = it.type?.defaultValue
 		it.writable = !variable.const
 	}
 
@@ -123,7 +123,7 @@ class DefaultExecutionContextInitializer implements IExecutionContextInitializer
 		it.name = event.fullyQualifiedName.lastSegment
 		it.fqName = event.fullyQualifiedName.toString
 		it.type = event.type
-		it.value = it.type.defaultValue
+		it.value = it.type?.defaultValue
 		it.direction = EventDirection.get(event.direction.value)
 	}