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 269108 - "@return static" does not work correctly
Summary: "@return static" does not work correctly
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: junichi11
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-24 18:30 UTC by rob006
Modified: 2017-04-22 01:52 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Invalid return type for method with @return static (61.26 KB, image/png)
2016-11-24 18:30 UTC, rob006
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rob006 2016-11-24 18:30:16 UTC
Created attachment 163019 [details]
Invalid return type for method with @return static

Code:

class A {

	/**
	 * Method description.
	 *
	 * @return static
	 */
	public static function test() {

	}
}

class B extends A {

	/**
	 * {@inheritdoc}
	 */
	public static function test() {
		return parent::test();
	}

	public static function testB() {

	}
}

class C extends B {

	public static function testC() {

	}
}

---

"C::test()->" gives you hints for A object instead of C (see attachment).
Comment 1 junichi11 2016-11-27 03:53:14 UTC
This occurs without {@inheritdoc}. So it's a CC problem. I'll look at it.

Thanks for reporting!
Comment 2 junichi11 2017-04-20 23:56:54 UTC
Fixed.

http://hg.netbeans.org/web-main/rev/f00b8098d5fc

Thanks.
Comment 3 Quality Engineering 2017-04-22 01:52:35 UTC
Integrated into 'main-silver', will be available in build *201704220002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f00b8098d5fc
User: Junichi Yamamoto <junichi11@netbeans.org>
Log: #269108 - "@return static" does not work correctly