Bug 397692 - error in declaration in to section not sufficiently catched
Summary: error in declaration in to section not sufficiently catched
Status: UNCONFIRMED
Alias: None
Product: MMT.ATL
Classification: Modeling
Component: emfvm (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: mmt-atl.toolkit-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-08 11:34 EST by fabtagon . CLA
Modified: 2013-01-08 11:34 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 fabtagon . CLA 2013-01-08 11:34:07 EST
When variables of native types are declared within a 'to' block, emfvm dies in an exception, notifies the user insufficiently, runs last instead of current version of program.

The glitch consists of two separate issues, see next paragraph.

== in detail ==

i) no useful error indication with native variable declarations in 'to' block [minor/wishlist]

Experienced behaviour: If the user declares a native type variable in 'to' block (which seems illegal which is ok), an exception is posted to console when storing the file. No further indication is present. The user explicitely has to look out for such an exception (and might miss it, if he's e.g. just changed a metamodel and a lot of files bring up error notifications). Narrowing down the issue becomes more complicated, as it's introduction is not detected until the program's results are checked (problem in connection with next section).

Wanted Behaviour: the user should be notified better, e.g. with an error notification (these red dots with white x next to line numbers) and a tool tip like 'declaration in to section on line X is illegal, move it into using section'.

It's not nice, but so far that's a tolerable issue.


ii) 'Running ATL program' does not care whether compilation has been successful [normal/severe]

Experienced behaviour: An errorneous program is written. After saving it, the ATL compiler tries to process it and dies in an exception. The user might miss the exception which is only printed to console. [That's the issue above so far.] Problem: When ordered to run the program (which just failed to compile), the program's previous version is run (as the previous version's .asm file still exists).

Expected behaviour: Even if the user's mistake is not detected in editing phase or when saving, no actual execution (which might trick the user into assuming his current program is correct and he's running his current program) should be possible.

The issue might be similar to #255533.


== source code & console message ==

Source code:

  module foomodule;
  create a:thing from b:nomatter;
  
  rule foo(){
    using {
      -- this is correct and works
      bar1 : Integer = 0;
    }
    to
      -- this is not correct and causes havoc
      bar2 : Integer
    do {
      'hello world'.println();
    }
  }

Error message on console:

  org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found: org.eclipse.m2m.atl.engine.asm.ASMEmitter@567477ea.emit(java.lang.String,org.eclipse.m2m.atl.engine.emfvm.lib.OclUndefined)
    at process#69(ATLCompiler.atl[1822:8-1822:26])
      local variables: self=IN!foo, forEach=Sequence {}, v=<null>, forEach=Sequence {IN!<unnamed>}, ope=IN!<unnamed>
    at process#2066(ATLCompiler.atl[463:3-463:24])
      local variables: self=IN!foomodule
    at main#37(ATLCompiler.atl)
      local variables: self=ATLCompiler : ASMModule, WriteTo='/destination/file.asm'