Skip to content

Conversation

@vaind
Copy link
Contributor

@vaind vaind commented Jul 6, 2021

The recently added unpack() used the default reader getters. Turns out, those read lists lazily wich breaks the "contract" of unpack() of reading the whole object at once. This PR fixes that to read lists eagerly.

@github-actions github-actions bot added c++ codegen Involving generating code from schema dart labels Jul 6, 2021
@aardappel
Copy link
Collaborator

@dnfield can you review.

/// If `lazy` is false, reads the whole list immediately on access.
class ListReader<E> extends Reader<List<E>> {
final Reader<E> _elementReader;
final bool lazy;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a docstring on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with docstring nit

@vaind vaind force-pushed the dart-unpack-lists branch from 57b2bce to adfb605 Compare July 9, 2021 06:48
@aardappel aardappel merged commit 3f77dc9 into google:master Jul 9, 2021
@vaind vaind deleted the dart-unpack-lists branch July 9, 2021 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ codegen Involving generating code from schema dart

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants