Bug 23117 - DOM: no error message for method with wrong return type
Summary: DOM: no error message for method with wrong return type
Status: VERIFIED 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.1 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 9598
  Show dependency tree
 
Reported: 2002-09-03 11:07 EDT by Dirk Baeumer CLA
Modified: 2002-09-19 11:04 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 Dirk Baeumer CLA 2002-09-03 11:07:42 EDT
2.x

- create the following CU
public class A {
	private int fClass;
	
	public void foo() {
	}

	void setClass(int c) {
		fClass = c;
	}

	int getClass() {
		return fClass;
	}
}

- create an AST for it

observe: the error messages reported by the AST doesn't contain a message for
the fact that the return type of "int getClass()" is incompatible with 
Object.getClass()
Comment 1 Olivier Thomann CLA 2002-09-04 16:04:45 EDT
This check is done with:
// verify inherited methods
if (unit.scope != null)
    unit.scope.verifyMethods(lookupEnvironment.methodVerifier());

This is not included in the resolve method of the compiler. Like this method is
also used for the code assist support, this resolution might have some
side-effects on the code assist.
Need to investigate.
Comment 2 Olivier Thomann CLA 2002-09-05 14:28:44 EDT
Fixed and released in 2.1 stream.
Comment 3 David Audel CLA 2002-09-19 04:44:45 EDT
Verified.
Comment 4 Olivier Thomann CLA 2002-09-19 11:04:24 EDT
Regression test added (test0385)