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

   ### Apache NetBeans version
   
   Apache NetBeans 16
   
   ### What happened
   
   When using **instanceof** operator against the interface the Netbeans can't 
find the declaration of that interface (right click on interface name and 
choose Navigate -> Go To Declaration). However it works fine for classes.
   
   I guess that IDE looking for the class only, however it should work fine 
with instances too. Reference to PHP documentation: 
https://www.php.net/manual/en/language.operators.type.php#example-124
   
   ### How to reproduce
   
   Simple code to reproduce
   
   ```php
   interface Foo
   {
        public function foo();
   }
   
   class Bar implements Foo
   {
        public function test()
        {
                echo 1;
        }
   }
   
   $a = new Bar();
   
   if ($a instanceof Bar) { //Do find declaration
        $a->test();
   }
   
   if ($a instanceof Foo) { //Can't find declaration
        $a->test();
   }
   ```
   
   If you Ctrl+Click on `Bar` in `$a instanceof Bar` line, the cursor will jump 
to `Bar` class declaration. However if you do the same for `Foo` interface, it 
won't work.
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Windows 10
   
   ### JDK
   
   16.0.1
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No
   
   ### Code of Conduct
   
   Yes


-- 
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