Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318871 - [compiler] not-optimal message on base-call w/o parens
Summary: [compiler] not-optimal message on base-call w/o parens
Status: CLOSED WONTFIX
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 0.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 0.7.1   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-05 06:51 EDT by Stephan Herrmann CLA
Modified: 2010-09-23 18:23 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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
.