| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
not even going to pretend like I understand this, or even read it all, but some initial notes, I hope you don't mind
I very much hope that this RFC gets to a point where it is voted on and hopefully passes, generics are great!
You may want to consider adding some kind of overview for how the implementation logic works (e.g. a new file in docs/source) to aid reviewers in understanding how all of the parts go together
You may want to also split this up, it currently adds support for
Classes, interfaces, traits, functions, methods, closures, and arrow functions
and an initial version might just support classes, interfaces, and methods. Just a thought, please don't take this as criticism - I really hope that something like this is added to PHP
Sorry, something went wrong.
|
Thanks for the review! On the internal docs: i'd lean toward holding off for now. If the RFC doesn't pass, we'd just throw the prose away; if it does, the API/internals will likely shift between now and acceptance, and I'd rather not rewrite the doc multiple times along the way. Once the RFC lands (hoping it does), I'm happy to write a proper INTERNALS section in one go against the final shape. or do you think there's value in having something now? (for review?) |
Sorry, something went wrong.
I was thinking that this would be for reviewers to understand the rest of the patch - you know it best, since you wrote it, but others could use a roadmap/overview. I don't even known where to start for giving an example of "something like ..." for this, so I'll give one for #16952 (which I know best because I wrote it)
Just to have an understanding of how all of the pieces fit together |
Sorry, something went wrong.
|
Makes sense. Will add it tomorrow morning 👍🏼 |
Sorry, something went wrong.
|
I checked the failing CircleCI ARM job. Current failure is only: Zend/tests/generics/inheritance/diamond/trait_diamond_variadic.phpt It prints the reflected type correctly: param: string|int
is union: yes
and then segfaults when the merged trait method is called: (new C)->sink(1, "x", 2, "y"). I built the branch locally on macOS arm64 with debug + ZTS and the same test passes for me, both plain and with opcache enabled. So this looks more like Linux ARM / JIT / merged arg_info lifetime than a test expectation issue. The useful split is probably to rerun that one test on the ARM worker with JIT disabled. If it only crashes with JIT, the bad path is likely the merged trait method clone being executable but not looking quite like a normal trait clone to the runtime/JIT. |
Sorry, something went wrong.
|
@prateekbhujel reproduced it locally in aarch64 Ubuntu 24.04 Docker container. pushing a fix now :) |
Sorry, something went wrong.
|
Opened it against the working branch here: carthage-software#2 |
Sorry, something went wrong.
|
Opened one more small PR against the working branch for a Reflection edge case I hit while testing transitive interfaces: It fixes ReflectionClass::getGenericArgumentsForParentInterface() returning an empty list when the generic ancestor is reached through a non-generic intermediate interface/class. |
Sorry, something went wrong.
|
Opened a small PR for the current CI failure here: carthage-software#4 The failing test was creating an inherited-method arg_info clone even though the method-level Box<O> return did not actually substitute any class-scope slot. |
Sorry, something went wrong.
|
Opened another Reflection follow-up against the working branch: carthage-software#5 It fixes nested transitive interface args, e.g. Mid<X> extends Root<Box<X>> plus Concrete implements Mid<int> reflecting Box<X> instead of Box<int>. This is mainly for consumers relying on Reflection metadata rather than reparsing source. |
Sorry, something went wrong.
|
Opened the concrete Reflection piece here: carthage-software#6 It keeps the current singular method alone, but adds an all-bindings view for tools that need to see cases like Foo, Foo from Reflection without reparsing source. It is stacked on #5 for now, so the diff should shrink once that one lands. |
Sorry, something went wrong.
|
Is there anything new? |
Sorry, something went wrong.
|
How is the current state? |
Sorry, something went wrong.
|
Why wasn’t this PR approved? |
Sorry, something went wrong.
Signed-off-by: azjezz <azjezz@protonmail.com>
| Back | FazBrowse Home | New Git URL |
RFC: https://wiki.php.net/rfc/bound_erased_generic_types
Note: This PR has been squashed, full history can be found in here