Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328621 - Use the inherited phpDoc to infer type when no info is available in the current implementation
Summary: Use the inherited phpDoc to infer type when no info is available in the curre...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact: Ilina Stefanova CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-25 11:13 EDT by Mauro Molinari CLA
Modified: 2020-05-14 11:17 EDT (History)
1 user (show)

See Also:


Attachments
patch (3.23 KB, patch)
2010-12-07 03:47 EST, xu jiaxi CLA
no flags Details | Diff
unit test (969 bytes, patch)
2010-12-07 03:48 EST, xu jiaxi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mauro Molinari CLA 2010-10-25 11:13:36 EDT
Suppose you have the following:

class A
{
	public function saySomething()
	{
		echo 'something';
	}
}


class B
{
	/**
	 * @param A $b
	 */
	public function makeSaySomething($b)
	{
		$b->| [1]
	}
}

class C extends B
{
	public function makeSaySomething($b)
	{
		$b->| [2]
	}
}

Invoke code completion at [1] and [2].
At [1] the editor correctly suggests saySomething() method.
At [2] it does not. I would expect it to do, since C extends B and C::makeSaySomething() does not provide its own phpDoc to tell something different about the $b parameter.

The same should apply if B were an interface and C implemented B.
Comment 1 xu jiaxi CLA 2010-12-07 03:47:43 EST
Created attachment 184686 [details]
patch
Comment 2 xu jiaxi CLA 2010-12-07 03:48:21 EST
Created attachment 184687 [details]
unit test
Comment 3 Zhongwei Zhao CLA 2011-01-10 02:48:49 EST
committed to head,thanks Xu!
Comment 4 Zhongwei Zhao CLA 2011-01-10 02:49:29 EST
change to fixed
Comment 5 Mauro Molinari CLA 2011-01-10 03:21:03 EST
Hi, thanks for the fix! What is the target milestone?
Comment 6 Ilina Stefanova CLA 2011-08-03 08:14:26 EDT
Verified.