Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318871

Summary: [compiler] not-optimal message on base-call w/o parens
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTJAssignee: Stephan Herrmann <stephan.herrmann>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 0.7   
Target Milestone: 0.7.1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Stephan Herrmann CLA 2010-07-05 06:51:57 EDT
Consider the following snippet within a role class of MyTeam:

  callin void m() {
    within (MyTeam.this)
      base.m; // missing "()"
  }

This gives two errors which are not very helpful:

    within (MyTeam.this)
                       ^
Syntax error on tokens, delete these tokens

        base.m;
            ^
Syntax error, insert ") Statement" to complete 

plus a warning:
Unnecessary semicolon

By comparison a "super.m" is interpreted as an (unresolvable) field access
with no secondary errors. This lets me think that with this rule

FieldAccess ::= 'base' '.' 'Identifier'
/.$putCase consumeInvalidBaseAccess(true); $break ./

we could give a much more precise error message.
Comment 1 Stephan Herrmann CLA 2010-09-04 09:45:07 EDT
The proposed fixed cannot easily be applied, because the additional
rule renders the grammar invalid. I could not find a legal grammar
extension for this particular case (LALR(1) constraints).

Closing as WONTFIX given that current reporting still somehow points
to the actual cause/syntax error.
Comment 2 Stephan Herrmann CLA 2010-09-23 18:23:43 EDT
.