OCL Error 2 [message #45784] |
Mon, 21 August 2006 13:15  |
Eclipse User |
|
|
|
In ValidationVisitorImpl I have found the following thing:
under
if (opcode == PredefinedType.CLOSURE) {
we can find:
if (TypeUtil.typeCompare(sourceElementType, iteratorElementType) < 0) {
}
My constellation is the following I have a
LogicalTool which is abstract and a ITBaseSystem which is a subcalss of
LogicalTool (ITBaseSystem->LogicalTool)
My expression is self->closure(uses) and context is a ITBaseSystem, the
uses set is defined in LogicalTool and I get the error message
Closure type (LogicalTool) does conform to source type (ITBaseSystem)
(If error 1 see newsgroup is fixed)
so the
if (TypeUtil.typeCompare(sourceElementType, iteratorElementType) < 0) {
}
does not chech the inheritance!
if I comment the "if" my evaluation is right
Chris
|
|
|
|
|
Re: OCL Error 2 [message #585775 is a reply to message #45784] |
Mon, 21 August 2006 13:21  |
Eclipse User |
|
|
|
ok the method "TypeUtil.typeCompare(sourceElementType, iteratorElementType)"
returns the following:
switch (TypeUtil.getRelationship(type1, type2)) {
case PredefinedType.SAME_TYPE:
return 0;
case PredefinedType.STRICT_SUBTYPE:
return -1;
case PredefinedType.STRICT_SUPERTYPE:
return 1;
so I think it should be:
if (TypeUtil.typeCompare(sourceElementType, iteratorElementType) > 0)
I have changed this in my code, how can I add this to repository?
Chris
Chris Lenz schrieb:
> In ValidationVisitorImpl I have found the following thing:
> under
> if (opcode == PredefinedType.CLOSURE) {
>
> we can find:
> if (TypeUtil.typeCompare(sourceElementType, iteratorElementType) < 0) {
> }
>
> My constellation is the following I have a
> LogicalTool which is abstract and a ITBaseSystem which is a subcalss of
> LogicalTool (ITBaseSystem->LogicalTool)
>
> My expression is self->closure(uses) and context is a ITBaseSystem, the
> uses set is defined in LogicalTool and I get the error message
> Closure type (LogicalTool) does conform to source type (ITBaseSystem)
> (If error 1 see newsgroup is fixed)
>
> so the
> if (TypeUtil.typeCompare(sourceElementType, iteratorElementType) < 0) {
> }
> does not chech the inheritance!
>
> if I comment the "if" my evaluation is right
> Chris
|
|
|
|
Powered by
FUDForum. Page generated in 0.04170 seconds