Allow goto definition from first class callables#3025
Allow goto definition from first class callables#3025przepompownia wants to merge 1 commit intophpactor:masterfrom
Conversation
|
This is rather an early experiment that started to work only on <?php
function foo(): int {}
foo();
$f = foo(...);but doesn't work on methods yet. For now, I am following the current behaviour on a real instance |
a81a42e to
f68d34c
Compare
|
The path through WorseReflection is, as usual, very complex, and I easily get lost there. On the other hand, for comparison, I have the path of the "normal" call expression and I'm trying to figure out the differences. This way, I tested what happens (in |
f68d34c to
81d6376
Compare
81d6376 to
f3b3acb
Compare
| ); | ||
|
|
||
| if (NodeUtil::isFirstClassCallable($node->parent)) { | ||
| return $methodCallContext->withType(new ClosureType( |
There was a problem hiding this comment.
this would imply that th method call returns a closure - which is not the case?
There was a problem hiding this comment.
I'm not sure if I understood correctly: would a simple method call have a chance of falling into this condition (uncaught by any test)? For example, hover would show closure type?
Fix: #2975