eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

The inferred element type of an empty collection is wrong #119

Closed eclipse-ocl-bot closed 1 month ago

eclipse-ocl-bot commented 1 month ago

| --- | --- | | Bugzilla Link | 164614 | | Status | CLOSED FIXED | | Importance | P1 major | | Reported | Nov 15, 2006 05:37 EDT | | Modified | May 27, 2011 02:41 EDT | | Version | 1.0.1 | | Reporter | Tord Alenljung |

Description

The inferred element type of an empty collection literal (e.g. Set{}) should be OclVoid and should thus conform to all other types. This is not the case unfortunately. The following should work, but it does not:

let a:Set(Integer)=Set{} in a

Error message: 'Init expression type does not conform to type of variable (a).'

eclipse-ocl-bot commented 1 month ago

By Tord Alenljung on Nov 15, 2006 05:42

The following does work

let a:Set(Integer)=Set{1,3,2} in a

which returns\ 2\ 1\ 3

eclipse-ocl-bot commented 1 month ago

By Christian Damus on Nov 15, 2006 09:34

Bug 164605 has been marked as a duplicate of this bug.

eclipse-ocl-bot commented 1 month ago

By Christian Damus on Jan 26, 2007 17:02

The inferred element type of empty collection literals is now OclVoid. This will result in the correct generalization of the element type to something more interesting when elements are "added" to it (note that "adding" actually creates new collections).

eclipse-ocl-bot commented 1 month ago

By Nick Boldt on Jan 28, 2008 16:36

Move to verified as per bug 206558.

eclipse-ocl-bot commented 1 month ago

By Ed Willink on May 27, 2011 02:40

Closing after over a year in verified state.

eclipse-ocl-bot commented 1 month ago

By Ed Willink on May 27, 2011 02:41

Closing after over a year in verified state.