OCL 2.0 NO IDEA Avatar
  1. OMG Issue

OCL2_ — result type

  • Key: OCL2_-50
  • Legacy Issue Number: 7479
  • Status: closed  
  • Source: OpenModeling ( Jos Warmer)
  • Summary:

    [2] The result type of the collect operation on a sequence type is a sequence,
    – the result type of ’collect’ on any other collection type is a Bag. The type
    – of the body is always the type of the elements in the return collection.
    context IteratorExp
    inv: name = ’collect’ implies
    if source.type.oclIsKindOf(SequenceType) then
    type =
    expression.type.collectionType->select(oclIsTypeOf(SequenceType))-
    >first()
    else
    type = expression.type.collectionType->select(oclIsTypeOf(BagType))-
    >first()
    endif
    ==> should be
    context IteratorExp
    inv: name = ’collect’ implies if source.type.oclIsKindOf(OclAbstractSyntax::Types::SequenceType) then
    self.type = StandardLibrary::StdLib::Sequence
    and
    self.Body.type = Body.type
    else
    self.type = StandardLibrary::StdLib::Bag
    and
    self.Body.type = Body.type
    endif

  • Reported: OCL 2.0b2 — Thu, 10 Jun 2004 04:00 GMT
  • Disposition: Resolved — OCL 2.0
  • Disposition Summary:

    No Data Available

  • Updated: Sun, 8 Mar 2015 13:35 GMT