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?
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: 786a5fb | Previous: 6a1bb5c | Ratio |
|---|---|---|---|
ConfigLoaderBench::benchJsonLoadConfig |
32.75369863013709 μs (± 1.16%) |
15.894285714285605 μs (± 2.03%) |
2.06 |
ConfigLoaderBench::benchJsonLoadConfigWithBuilder |
34.58410958904122 μs (± 1.17%) |
17.048845401174 μs (± 2.23%) |
2.03 |
ConfigLoaderBench::benchJsonPlainPhp |
19.635342465753375 μs (± 2.20%) |
7.418434442270081 μs (± 3.04%) |
2.65 |
This comment was automatically generated by workflow using github-action-benchmark.
786a5fb to
5813543
Compare
Fix: #2975