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 13:03 Go to next message
Sergey Boyko is currently offline Sergey BoykoFriend
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 14:03 Go to previous message
Eclipse UserFriend
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 Dec 22 10:06:47 GMT 2014

Powered by FUDForum. Page generated in 0.01725 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software