Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366926 - /* @var */ completion does not use correct scope
Summary: /* @var */ completion does not use correct scope
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P2 enhancement (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-16 05:35 EST by sparrow Mising name CLA
Modified: 2020-05-14 11:09 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sparrow Mising name CLA 2011-12-16 05:35:36 EST
In the following example:

	public function method1()
	{
		$table = ...; /* @var $table Class1 */
		...
	}

	public function method2()
	{
		$table = ...; /* @var $table Class2 */
		$table.
		...
	}
	
completion for the second $table shows method of Class1 instead of Class2
Comment 1 Zhongwei Zhao CLA 2012-05-15 01:24:30 EDT
fixed
Comment 2 Zhongwei Zhao CLA 2012-07-09 22:44:41 EDT
Full example:

<?php
class Class1 {
	function test1() {
		;
	}
}
class Class2 {
	function test2() {
		;
	}
}
class Class3 {

    public function method1()
    {
        $table = ""; /* @var $table Class1 */
    }

    public function method2()
    {
        $table = ""; /* @var $table Class2 */
        $table->| //here should propose test2
    }
}
Comment 3 Sylvia Tancheva CLA 2012-07-10 03:57:35 EDT
Verified. Closing.
Ilina Stefanova

Thanks, Zhao