Bug 350920 - [content assist] Extending a method causes it's type annotations to be lost
Summary: [content assist] Extending a method causes it's type annotations to be lost
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-01 06:47 EDT by Dominic Chambers CLA
Modified: 2013-06-19 11:11 EDT (History)
0 users

See Also:


Attachments
Test case for this bug report (424 bytes, application/x-javascript)
2011-07-01 06:47 EDT, Dominic Chambers CLA
no flags Details

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