Bug 12418 - Weird secondary error in constructor reconciliation
Summary: Weird secondary error in constructor reconciliation
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-28 07:30 EST by Philipe Mulet CLA
Modified: 2002-03-28 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 Philipe Mulet CLA 2002-03-28 07:30:11 EST
Build 20020326

When reconciling with type errors in RecoveredMethod constructor, if causing a 
syntax errors beyond the constructor call, and weird error is surfaced claiming 
that the super constructor with no-arg cannot be found.

In this case, it should not even bother type checking the method at all... 
guessing a default constructor call is added without checking for syntax errors.

test case should be:

class X {
  X(int i){}
}


class Y extends X {
  Y (int i){
    super(i);
    System.out.println(   // syntax error
  }
}
Comment 1 Philipe Mulet CLA 2002-03-28 10:59:34 EST
This is due to the fact that an implicit constructor call is always added when 
reducing the constructor declaration in diet mode. After that point, it will be 
overriden by an eventual one which will be discovered when retrieving method 
body. 

It should only do so in non-diet mode.

Fixed