PHP RFC: Bound-Erased Generic Types#21969
Conversation
Signed-off-by: azjezz <azjezz@protonmail.com>
Signed-off-by: azjezz <azjezz@protonmail.com>
Signed-off-by: azjezz <azjezz@protonmail.com>
Signed-off-by: azjezz <azjezz@protonmail.com>
… API Signed-off-by: azjezz <azjezz@protonmail.com>
…resolve type-parameter refs Signed-off-by: azjezz <azjezz@protonmail.com>
…atic, and parent Signed-off-by: azjezz <azjezz@protonmail.com>
…antics Signed-off-by: azjezz <azjezz@protonmail.com>
Signed-off-by: azjezz <azjezz@protonmail.com>
…litting) Signed-off-by: azjezz <azjezz@protonmail.com>
…ectionClass Signed-off-by: azjezz <azjezz@protonmail.com>
Signed-off-by: azjezz <azjezz@protonmail.com>
… error only at runtime use Signed-off-by: azjezz <azjezz@protonmail.com>
…minal Signed-off-by: azjezz <azjezz@protonmail.com>
…ce and reflection cleanup Signed-off-by: azjezz <azjezz@protonmail.com>
DanielEScherzer
left a comment
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
Signed-off-by: azjezz <azjezz@protonmail.com>
Signed-off-by: azjezz <azjezz@protonmail.com>
…lookups Signed-off-by: azjezz <azjezz@protonmail.com>
|
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?) |
Signed-off-by: azjezz <azjezz@protonmail.com>
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 |
|
Makes sense. Will add it tomorrow morning 👍🏼 |
Signed-off-by: azjezz <azjezz@protonmail.com>
RFC: https://wiki.php.net/rfc/bound_erased_generic_types