Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354551 - No type-inference for return types with use statements
Summary: No type-inference for return types with use statements
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-11 16:48 EDT by Robert Gruendler CLA
Modified: 2020-05-14 10:16 EDT (History)
3 users (show)

See Also:


Attachments
reproducable test case (1.21 KB, application/zip)
2011-08-11 16:49 EDT, Robert Gruendler CLA
no flags Details
new SomeClass (96 bytes, application/octet-stream)
2011-11-08 21:29 EST, Zhongwei Zhao CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Gruendler CLA 2011-08-11 16:48:53 EDT
Build Identifier: I20110613-1736

type inference does not work for methods annotated with PHPdocs which return a class imported through a "use" statement. ie:

use Foo\Bar\SomeClass;

/**
 * @return SomeClass
 * 
*/
public function getSome() {

  return new SomeClass();
}




Reproducible: Always

Steps to Reproduce:
Create a PDT project, import the 3 attached files, try to complete the $some variable in Test.php
Comment 1 Robert Gruendler CLA 2011-08-11 16:49:42 EDT
Created attachment 201353 [details]
reproducable test case
Comment 2 Zhongwei Zhao CLA 2011-10-11 03:23:30 EDT
fixed in head
Comment 3 Kalin CLA 2011-10-18 05:18:47 EDT
Still reproducible. No relevant item is suggested.
Comment 4 Zhongwei Zhao CLA 2011-11-08 21:29:57 EST
Created attachment 206638 [details]
new SomeClass
Comment 5 Zhongwei Zhao CLA 2011-11-08 21:31:15 EST
the original SomeClass does not have any methods or public fields,so no  is suggested.
Please the attached file to test.
Comment 6 Kalin CLA 2012-07-03 10:07:22 EDT
Verified fixed.
Closing...

Kalin Yanev
kalin.a@zend.com