Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL type conformance
OCL type conformance [message #26758] Tue, 05 June 2007 09:03 Go to next message
Sergey Boyko is currently offline Sergey Boyko
Messages: 162
Registered: July 2009
Senior Member
Hello,

It seems that OCL standart library didn't define '=' and '<>' operations for
CollectionTypes on OclInvalid type. This leads to non-symmetric behaviour of
these operations.

For example:
Sequence{1} <> OclInvalid
is correct
but
OclInvalid <> Sequence{1}
produce syntax error:
<ERROR in (operationCallExpCS): (Cannot find operation (<>(Sequence(Integer)))
for the type (Invalid))>.


Regards,
Sergey.
Re: OCL type conformance [message #26842 is a reply to message #26758] Tue, 05 June 2007 10:03 Go to previous message
Eclipse User
Originally posted by: cdamus.ca.ibm.com

Hi, Sergey,

Invalid is defined as conforming to all other types in the OCL type system,
as is the case with OclVoid. Leaving aside the fact that it is impossible
to have two such types at the bottom of the type system, your second
example should not result in a parse error because OclInvalid should
inherit all of the following operations:

<> (object : OclAny) : Boolean
<> (s : Set) : Boolean
<> (s : Sequence) : Boolean
<> (b : Bag) : Boolean

from OclAny, Set(T), Sequence(T), and Bag(T), respectively (in addition to
the corresponding = operations).

Would you mind raising a bug for this? I don't expect that it would be
fixed at this late stage of the 1.1 release, as your first example does
work and is probably the most "natural" formulation (I hope?).

Thanks,

Christian


Sergey Boyko wrote:

> Hello,
>
> It seems that OCL standart library didn't define '=' and '<>' operations
> for CollectionTypes on OclInvalid type. This leads to non-symmetric
> behaviour of these operations.
>
> For example:
> Sequence{1} <> OclInvalid
> is correct
> but
> OclInvalid <> Sequence{1}
> produce syntax error:
> <ERROR in (operationCallExpCS): (Cannot find operation
> (<>(Sequence(Integer))) for the type (Invalid))>.
>
>
> Regards,
> Sergey.
Previous Topic:OCLHelper
Next Topic:creating a OCL constraint provider.
Goto Forum:
  


Current Time: Mon Jul 28 14:38:09 EDT 2014

Powered by FUDForum. Page generated in 0.05506 seconds