Repository navigation
Support subclasses of bytearray too in Bytes and GreedyBytes - #1191
Open
matthijskooijman wants to merge 2 commits into
Open
matthijskooijman wants to merge 2 commits into
matthijskooijman wants to merge 2 commits into
Conversation
Bytes and Greedybytes accepted bytarray instances Since commit 8d76dfb (Bytes* fixed (allows to build from bytearrays) per construct#827, 2020-01-21), but did not use instanceof to check so would not accept bytearray subclasses. From the commit, there does not seem to be any particular reason for this, so this changes from an exact type match to using instanceof.
Without an explicit subcon, Const would default to Bytes. It would then insist the value passed is a bytes, even though Bytes also accepts a bytearray. So also accept bytearray here.
Author
|
Just pushed one additional commit that lets Const also accept bytearray values. |
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.
Bytes and Greedybytes accepted bytarray instances Since commit 8d76dfb (Bytes* fixed (allows to build from bytearrays) per #827, 2020-01-21), but did not use instanceof to check so would not accept bytearray subclasses. From the commit, there does not seem to be any particular reason for this, so this changes from an exact type match to using instanceof.