Fix the return value of Restreamed._build.#1119
Open
rurik-supermassive wants to merge 1 commit intoconstruct:masterfrom
Open
Fix the return value of Restreamed._build.#1119rurik-supermassive wants to merge 1 commit intoconstruct:masterfrom
Restreamed._build.#1119rurik-supermassive wants to merge 1 commit intoconstruct:masterfrom
Conversation
Similar to `Transformed._build`, it now correctly returns the output of its `subcon` build.
Before this commit using `Restreamed` would fail when accessing the context as in the
following example:
```python
RestreamedPassthrough = lambda subcon: Restreamed(subcon, lambda b: b, 1, lambda b: b, 1, lambda n: n)
x = Struct(a=RestreamedPassthrough(Const(1, Byte)), b=Rebuild(Byte, this.a))
x.build({})
```
In the `Rebuild` context `a` was not populated and was `None`. With this fix it is correctly
populated with the built context of the sub-construct.
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.
Similar to
Transformed._build, it now correctly returns the output of itssubconbuild.Before this commit using
Restreamedwould fail when accessing the context as in the following example:In the
Rebuildcontextawas not populated and wasNone. With this fix it is correctly populated with the built context of the sub-construct.