Bug 236247 - OperationCallExp arguments_conform constraint looks up operation
Summary: OperationCallExp arguments_conform constraint looks up operation
Status: CLOSED FIXED
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 1.2.0   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: M4   Edit
Assignee: Adolfo Sanchez-Barbudo Herrera CLA
QA Contact:
URL:
Whiteboard: Extensibility
Keywords: contributed, plan
Depends on: 232028
Blocks:
  Show dependency tree
 
Reported: 2008-06-09 10:36 EDT by Christian Damus CLA
Modified: 2011-05-27 02:42 EDT (History)
2 users (show)

See Also:


Attachments
Test Case (3.59 KB, patch)
2008-12-01 12:14 EST, Adolfo Sanchez-Barbudo Herrera CLA
give.a.damus: iplog+
Details | Diff
Fixing patch (3.13 KB, patch)
2008-12-01 12:59 EST, Adolfo Sanchez-Barbudo Herrera CLA
give.a.damus: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2008-06-09 10:36:36 EDT
This is a clone of bug 232028 which has now been used to resolve a regression caused by the original resolution of this problem.

In the 1.3 release, the implementation of the arguments_conform constraint on OperationCallExp should be reworked to accurately check the type conformance of the arguments and parameters, without resorting (as did the ValidationVisitor) to looking up the called operation again in the model.

The conformance check will have to account for:

  - parameters of type T/T2/etc. (generic type parameters)
  - parameters of collection types with T/T2/etc. element type

which resolution depends on the source type of the operation call expression.
Comment 1 Adolfo Sanchez-Barbudo Herrera CLA 2008-12-01 12:14:10 EST
Created attachment 119175 [details]
Test Case

Test case recovered from bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=232028, which includes the case where a generic collection is returned by an OCL Expression. It might be useful since it exposes the bad behaviour of the previous erroneous patch.

The patch comes soon.
Comment 2 Adolfo Sanchez-Barbudo Herrera CLA 2008-12-01 12:59:27 EST
Created attachment 119180 [details]
Fixing patch

The proposed patch makes use of the TypeUtil.matchArgs API method, which takes care of the resolution of generic types when needed.

Ecore and UML test cases pass. Mine do pass as well.
Comment 3 Christian Damus CLA 2008-12-02 07:12:12 EST
Patches committed to HEAD (1.3 branch).

Thanks, Adolfo!  Nice work.  Including a new test case and copyright headers!
Comment 4 Christian Damus CLA 2008-12-04 10:35:25 EST
Fix available in HEAD: 1.3.0.I200812021600.
Comment 5 Ed Willink CLA 2011-05-27 02:40:52 EDT
Closing after over a year in verified state.
Comment 6 Ed Willink CLA 2011-05-27 02:42:04 EDT
Closing after over a year in verified state.