Bug 12418

Summary: Weird secondary error in constructor reconciliation
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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