Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328325 - Assignment using = fails in switch-case
Summary: Assignment using = fails in switch-case
Status: CLOSED FIXED
Alias: None
Product: Epsilon
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Dimitris Kolovos CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-21 05:03 EDT by Dimitris Kolovos CLA
Modified: 2012-02-06 10:59 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitris Kolovos CLA 2010-10-21 05:03:03 EDT
Original message from the newsgroup follows:


> Hi,
>
> I encountered a strange behavior inside a switch-case statement. It
> comes down to this.
>
>
> rule exampleTrafo
> transform d : Source!Domain
> to d : Target!Domain{
>
> var choice = "bigDecision";
>
> switch(choice){
> case "bigDecision" : var temp = createSomething();
> if(not temp.isDefined())
> "ohh boy".println();
> }
> }
>
> operation createSomething() : Target!Element1{
> var returnValue = new Target!Element1;
> if(returnValue.isDefined())
> "I'm ready to go".println();
> return returnValue;
> }
>
>
> I would expect to get a plain "I'm ready to go" , unfortunately I get
> the following output:
>
> Buildfile: /Users/henning/Documents/workspaces/diplom/my.example/launch
> .xml
>
> loadModels:
>
> main:
> [epsilon.etl - exampleTrafo.etl] I'm ready to go
> [epsilon.etl - exampleTrafo.etl] ohh boy
> BUILD SUCCESSFUL
> Total time: 246 milliseconds
>
> Is this behavior intended?
>
> Best regards,
>
> Henning
Comment 1 Dimitris Kolovos CLA 2010-11-04 08:06:55 EDT
Fixed in the latest interim version (0.8.9.201011041158).
Comment 2 Dimitris Kolovos CLA 2010-11-25 08:23:31 EST
Fixed in 0.9.0.