eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[evaluator] Collection.sum should work for user-defined types #501

Closed eclipse-ocl-bot closed 2 hours ago

eclipse-ocl-bot commented 2 hours ago

| --- | --- | | Bugzilla Link | 299843 | | Status | CLOSED DUPLICATE of bug 301351 | | Importance | P3 normal | | Reported | Jan 16, 2010 08:00 EDT | | Modified | May 12, 2018 15:51 EDT | | Version | 3.0.0 | | Blocks | 318248 | | See also | 534610 | | Reporter | Ed Willink |

Description

CollectionUtil.sum is restricted to the built-in Integer and Real types.

It should work for any type that implements binary T::_'+'(T) : T.

CollectionUtil.sum returns null for sum over an empty set!

But how is zero constructed for an arbitrary user type?

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Feb 01, 2010 16:49

OMG Issue 15010 raised suggesting a T::zero() operation.

A T::0 property might be more sensible.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Nov 08, 2011 04:51

The new pivot evaluator works for any type that implements OclSummable.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on May 02, 2012 16:42

Resolution in Bug 301351

This bug has been marked as a duplicate of bug 301351

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on May 20, 2013 11:37

CLOSED after a year in the RESOLVED state.