-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Disjunctive Normal Form Types #558
Comments
Noting that getTypes() for the following code may now (PHP8.2) return 'ReflectionIntersectionType': prophecy/src/Prophecy/Prophecy/MethodProphecy.php Lines 90 to 92 in a4477cd
prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php Lines 224 to 226 in a4477cd
I'm unsure what the underlying decision to not support Possible solution would be to loop through types looking for It does throw an err. The class effectively turns this:
Into
All this said, I'm confused by something, so going to ping the php-src group. Either found a bug or something I don't understand. |
Simply that PHP 8.1 was coming and we wanted a clear exception to be thrown here rather than a hard error Nobody's made it work since (or TBH has raised an issue) |
if someone wants to make intersection types work that's fine, to be clear |
The issue tracking proper support for intersection types is #535, but nobody worked on it yet. |
See https://wiki.php.net/rfc/dnf_types
We need to make sure they can be doubled properly, with tests ensuring they work fine.
The text was updated successfully, but these errors were encountered: