This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 270345 - Wrong autocomplete on property named "type"
Summary: Wrong autocomplete on property named "type"
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: PHPDoc (show other bugs)
Version: 8.2
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: issues@php
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-10 12:24 UTC by Alex27
Modified: 2017-04-10 12:31 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (34.80 KB, application/octet-stream)
2017-04-10 12:24 UTC, Alex27
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex27 2017-04-10 12:24:12 UTC
Created attachment 164063 [details]
IDE log

When property of some class is named "type" its type is detected incorrectly.
It seems that property with name "type" is always considered being of
type it belongs to.

Example 1 (magic property "type"):

/**
 * @property ClassB $type
 */
class ClassA
{
	public $aProp;
}

class ClassB
{
	public $bProp;
}

$aObject = new ClassA;
$aObject->type->; //suggestions here do not include ClassA properties (instead of ClassB)


Example 2 (simple property "type"):

class ClassA
{
	public $aProp;
	
	/**
	 *
	 * @var ClassB
	 */
	public $type;
}

class ClassB
{
	public $bProp;
}

$aObject = new ClassA;
$aObject->type-> //suggestions here do not include ClassA properties (instead of ClassB)
Comment 1 Alex27 2017-04-10 12:31:13 UTC
Excuse me, I made a mistake in the comment:
//suggestions here do not include ClassA properties (instead of ClassB)

I meant:
//suggestions here include ClassA properties (instead of ClassB)