-
Notifications
You must be signed in to change notification settings - Fork 874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PHP] @return static
is broken
#7192
Milestone
Comments
Please write a minimal example to reproduce it soon. |
@junichi11 here is minimal repro: <?php
declare(strict_types=1);
namespace Atk4\Repro;
trait MyHookTrait {}
trait MyStaticAddToTrait
{
/**
* @return static
*/
public static function addTo()
{
return new static();
}
}
abstract class MyBase
{
use MyStaticAddToTrait;
}
class MyForm extends MyBase
{
use MyHookTrait;
public function foo(): void {}
}
MyForm::addTo()-> when you type And my observation is when |
@junichi11 were you able to reproduce it? |
@mvorisek Reproducible. Thanks! |
junichi11
added a commit
to junichi11/netbeans
that referenced
this issue
Jun 3, 2024
- apache#7192 - Set a caller type when a method type is a trait and the caller type is not the same as the method type - Add unit tests
junichi11
added a commit
to junichi11/netbeans
that referenced
this issue
Jun 3, 2024
- apache#7192 - Set a caller type when a method type is a trait and the caller type is not the same as the method type - Add unit tests
junichi11
added a commit
that referenced
this issue
Jun 4, 2024
Fix the Code Completion for `static` return type #7192
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apache NetBeans version
Apache NetBeans 21
What happened
@return static
PHPDoc typehinting is broken.It used to work, but I have upgraded to Netbeans 21 and it does no longer work. Instead of typehinting all the
static
class methods, with complex inheritance, there is some issue.Language / Project Type / NetBeans Component
PHP
How to reproduce
repro files:
https://github.com/atk4/core/blob/18741e5c99/src/StaticAddToTrait.php#L37
https://github.com/atk4/ui/blob/5fc79edc29/src/AbstractView.php#L31
https://github.com/atk4/ui/blob/5fc79edc29/src/View.php
https://github.com/atk4/ui/blob/5fc79edc29/src/Form.php
Did this work correctly in an earlier version?
Apache NetBeans 16 or earlier
Operating System
any
JDK
any
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
No response
Are you willing to submit a pull request?
No
The text was updated successfully, but these errors were encountered: