Allow goto definition from first class callables#3025
Allow goto definition from first class callables#3025dantleech merged 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?
f3b3acb to
786a5fb
Compare
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Phpactor Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.
| Benchmark suite | Current: bb90d5f | Previous: 77f9ff9 | Ratio |
|---|---|---|---|
ConfigLoaderBench::benchJsonPlainPhp |
0.01542590998043056 ms (± 7.04%) |
0.007386810176125254 ms (± 3.09%) |
2.09 |
This comment was automatically generated by workflow using github-action-benchmark.
786a5fb to
5813543
Compare
5813543 to
bb90d5f
Compare
Fix: #2975