| [news.eclipse.modeling.mdt.uml2.ocl] Re: How to declare type of empty collection in OCL? |
Tord,
I'll forward your question to the new OCL newsgroup.
How can I declare that for example a Set contains objects of some type and then initialize it to be empty. Neither I or II below works, but III does.
(I) Not OK let a:Set(Integer)=Set{} in a
'Init expression type does not conform to type of variable (a).'
(II) Not OK let a:Set(Integer)=Set(Integer){} in a
'1:20:1:31 "collectionTypeIdentifierCS" expected instead of "Set(Integer)"'
(III) OK let a:Set(Integer)=Set{1,3,2} in a
2 1 3
Regards Tord