unable to see my error [message #33571] |
Thu, 19 July 2007 22:19 |
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 |
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.
|
|
|
Powered by
FUDForum. Page generated in 0.02780 seconds