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

Bug 328621

Summary: Use the inherited phpDoc to infer type when no info is available in the current implementation
Product: z_Archived Reporter: Mauro Molinari <mauromol>
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: CLOSED FIXED QA Contact: Ilina Stefanova <ilina.s>
Severity: normal    
Priority: P3 CC: ilina.s
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
patch
none
unit test none

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.