Bug 485560 - Leverage type inference for If expressions
Summary: Leverage type inference for If expressions
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 3.1.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.0.0M5   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks: 485136
  Show dependency tree
 
Reported: 2016-01-11 10:18 EST by Cedric Brun CLA
Modified: 2016-06-24 08:02 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Brun CLA 2016-01-11 10:18:16 EST
On pattern we often see in a tool definition of Sirius is :

If someVariable.oclIsKindOf(some::Type)
  ChangeContext : someVariable.someRefExistingInType

If someVariable.oclIsKindOf(some::OtherType)
  Set : someAttributeExistingInOtherType 

Right now Sirius will find the type of "someVariable" based on the .odesign declarations and on the return types of the IInterpreter instances. It will not leverage the fact that it is in the "then" branch of an IF and as such we know the type of someVariable have to be some::Type.

This bugzilla is about improving Sirius to consider this information which can be provided -- at least by the AQL interpreter-- 

This should drastically reduce the number of errors reported in the .odesign files.

Steps to reproduce : 
- open interaction.design
- select the children of the first "If" which has the expression : 
aql:end.oclIsKindOf(interactions::ExecutionEnd) in the tool "Delete Participant"
The children is a ChangeContext aql:end.execution
- right click->validate 
result : 
an error stating the feature "execution" is not found in the EClass EObject
expected result : no validation error
Comment 1 Eclipse Genie CLA 2016-01-11 10:25:30 EST
New Gerrit change created: https://git.eclipse.org/r/64004
Comment 3 Cedric Brun CLA 2016-01-22 05:21:18 EST
This is fixed for Sirius 4.0 and will be shipped with M5.
Comment 4 Florian Barbin CLA 2016-05-20 11:42:31 EDT
Verified on Sirius 4.0.0.201605180923
Comment 5 Pierre-Charles David CLA 2016-06-24 08:02:09 EDT
Available in Sirius 4.0.0.