From 32772d3bba0483a6119f7135a22e59a4389ef055 Mon Sep 17 00:00:00 2001 From: Ed Willink Date: Thu, 22 Sep 2016 21:40:55 +0100 Subject: [500962] Correct GuardParameterBinding WFRs --- .../org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl index 1035f50b8..e3d7cb5e7 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl @@ -31,9 +31,6 @@ def: referringNames : Set(String) = binding.boundVariable.name->asSet() inv MatchingCallBindings('Mismatched bindings ' + referredMapping.name + joinNames(referredNames) + ' <= ' + joinNames(referringNames)): referredNames = referringNames inv UniqueCallBindings: binding->isUnique(boundVariable) -context GuardParameterBinding -inv CompatibleBinding: value.type.conformsTo(boundVariable.type) or boundVariable.type.conformsTo(value.type) - endpackage package qvtimperative @@ -66,8 +63,9 @@ inv NoRealizedVariableNavigations: ownedExpression->closure(oclContents())->sele -- if mapping.isToMiddle then area = mapping else area.oclAsType(CoreDomain).isEnforceable endif context GuardParameterBinding -inv CheckedTypeIsNotConformant: isCheck implies not value.type.conformsTo(boundVariable.type) -inv UncheckedTypeIsConformant: not isCheck implies value.type.conformsTo(boundVariable.type) +inv CheckedTypeIsNotConformant: isCheck implies let elementType = value.type.oclAsType(ocl::CollectionType).elementType in not elementType.conformsTo(boundVariable.type) +inv UncheckedTypeIsConformant: not isCheck implies let elementType = value.type.oclAsType(ocl::CollectionType).elementType in elementType.conformsTo(boundVariable.type) +inv CompatibleBinding: let elementType = value.type.oclAsType(ocl::CollectionType).elementType in elementType.conformsTo(boundVariable.type) or boundVariable.type.conformsTo(elementType) context SimpleParameterBinding inv CheckedTypeIsNotConformant: isCheck implies not value.type.conformsTo(boundVariable.type) -- cgit v1.2.3