headbank opened a new issue, #9417:
URL: https://github.com/apache/netbeans/issues/9417

   ### Apache NetBeans version
   
   Apache NetBeans 30
   
   ### What happened
   
   When an overriding method in a PHP child class calls the parent class's 
overridden method using the `parent::` identifier, and that method's 
return-type is `static`, NetBeans fails to resolve the variable returned by 
that call to an instance of the current (that is, child) class. Other members 
of the child class are not available in autocomplete, and the tooltip displayed 
by Ctrl+hover gives simply `VARIABLE: $whatever`.
   
   ### Language / Project Type / NetBeans Component
   
   PHP project
   
   ### How to reproduce
   
   ```php
   <?php
   
   class Foo1 {
   
        public static function make(): static {
                return new static();
        }
   }
   
   class Foo2 extends Foo1 {
        
        public $property = 1;
        
        public static function make(): static {
                $f = parent::make();
                echo $f->//<-- Start typing 'property' here
                return $f;
        }
   }
   ```
   Place the cursor before the inline comment on line 16 and start to type 
'property'. The `$property` property of class `Foo2` should be available in 
autocomplete popup; instead, only general completions are offered.
   
   Calling `parent::make()` in the child scope returns a `Foo2` object; this is 
knowable from the `static` return type declared by `Foo1::make()` and NetBeans 
should make this determination.
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Gentoo Linux
   
   ### JDK
   
   Adoptium openjdk-21.0.10_p7
   
   ### Apache NetBeans packaging
   
   Apache NetBeans binary zip
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to