Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » unable to see my error
unable to see my error [message #33571] Thu, 19 July 2007 22:19 Go to next message
Eclipse User
Originally posted by: firstname.name.gmail.com

It is me again,

First, I want to beg your pardon for my /too frequents/ posts..

I am "playing" with the OCL console, and I can't see my error. So I decided to
get helps from experts. I would like to use nested tuple

so, this command is successfully parsed:
let t: Tuple(a : Tuple(b:String, c:String))=
Tuple{
a=Tuple{b='b', c='c'}
} in t

but this one fails:
let t: Tuple(a : Tuple(b:String, c:String), d: String)=
Tuple{
a=Tuple{b='b', c='c'},
d='d'
} in t

I get:

Property (a) not found in tuple type:
(Tuple{a : Tuple(b : String, c : String) = Tuple{b : String = 'b', c : String = 'c'}, d : String = 'd'})


thanks in advance.
--
F. Lagarde
Re: unable to see my error [message #33605 is a reply to message #33571] Fri, 20 July 2007 13:59 Go to previous message
Eclipse User
Originally posted by: cdamus.ca.ibm.com

Hi, Fran├žois,

Your posts are most definitely not too frequent! I am very happy to see
that OCL has a lively user community.

This problem is a consequence of this bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=192832

which is fixed in the latest 1.1.1 maintenance build. Basically, the
TypeResolver's matching of tuple types was messed up and matched your
tuple-literal (a, d) against the type definition of (b, c) so that when it
came to evaluation, the "a" part was not found.

Your first example worked because the resolver could tell the difference
between tuple types having a different number of parts.

I tested your Tuple expression in the 1.1.1 build and it works.

Cheers,

Christian


Fran├žois Lagarde wrote:

> It is me again,
>
> First, I want to beg your pardon for my /too frequents/ posts..
>
> I am "playing" with the OCL console, and I can't see my error. So I
> decided to get helps from experts. I would like to use nested tuple
>
> so, this command is successfully parsed:
> let t: Tuple(a : Tuple(b:String, c:String))=
> Tuple{
> a=Tuple{b='b', c='c'}
> } in t
>
> but this one fails:
> let t: Tuple(a : Tuple(b:String, c:String), d: String)=
> Tuple{
> a=Tuple{b='b', c='c'},
> d='d'
> } in t
>
> I get:
>
> Property (a) not found in tuple type:
> (Tuple{a : Tuple(b : String, c : String) = Tuple{b : String = 'b', c :
> String = 'c'}, d : String = 'd'})
>
>
> thanks in advance.
Previous Topic:helper definition within the OCL console
Next Topic:Bug getting the CollectionType Name
Goto Forum:
  


Current Time: Fri Sep 19 11:51:59 GMT 2014

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

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