Allow generators to have a real return type of mixed#5626
Closed
TysonAndre wants to merge 1 commit into
Closed
Allow generators to have a real return type of mixed#5626TysonAndre wants to merge 1 commit into
mixed#5626TysonAndre wants to merge 1 commit into
Conversation
Contributor
Author
|
The travis build failure was caused by |
nikic
reviewed
May 25, 2020
Member
There was a problem hiding this comment.
This should actually check for & (MAY_BE_ITERATABLE|MAY_BE_OBJECT) != 0. : object is also a fine type.
Member
There was a problem hiding this comment.
At which point we should really adjust the error message to be generic and not list every single possible type. Something along the lines of...
Cannot use %s as generator return type, because it is not a supertype of Generator
Generator return type must be a supertype of Generator, %s given
Fixes an edge case overlooked in php#5313 Generators are objects, so `object` should have also been allowed in addition to `iterable` and `Traversable`
6a80137 to
e0ee8b2
Compare
Member
|
Thank you, @TysonAndre! |
nikic
approved these changes
May 26, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes an edge case overlooked in
#5313