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

Bug 350920

Summary: [content assist] Extending a method causes it's type annotations to be lost
Product: [WebTools] JSDT Reporter: Dominic Chambers <dominic.chambers>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: NEW --- QA Contact: Chris Jaun <cmjaun>
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Test case for this bug report none

Description Dominic Chambers CLA 2011-07-01 06:47:18 EDT
Build Identifier: 20110505-1223

If you extend a class (using either @extend or proper javascript inheritance) you automatically pick up the methods in instances of the sub-class, and those instances inherit the type annotations defined for the super class.

If you override one of the extended methods however, you lose all the type information. A sub-method could in theory change the contract of a particular method (though this breaks Liskov's substitution principle and prevents a polymorphic handling of the type) by defining different annotations for the method, but this is not being done here, and the extended method contains no annotations whatsoever.


Reproducible: Always

Steps to Reproduce:
1. Open the provided test case file in Eclipse.
2. Try to get Content Assist for oSubClass.getX() and oSubClass.getY()
3. You will notice that you only get the correct type information for getX()
Comment 1 Dominic Chambers CLA 2011-07-01 06:47:56 EDT
Created attachment 198956 [details]
Test case for this bug report