Skip to content
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

Fix default list type for frozen messages #654

Merged
merged 2 commits into from
May 17, 2022

Conversation

osa1
Copy link
Member

@osa1 osa1 commented May 16, 2022

Without the fix the test fails with

check read-only default list type [E]
  type '() => int' is not a subtype of type '(() => Never)?' of 'orElse'
  dart:collection                                    ListMixin.firstWhere
  package:protobuf/src/protobuf/pb_list.dart 260:20  PbListBase.firstWhere
  test/repeated_field_test.dart 40:12                main.<fn>

This is because the expression const [] has type List<Never> in
_FieldSet._getDefaultList.

Copy link
Collaborator

@sigurdm sigurdm left a comment

Choose a reason for hiding this comment

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

LGTM

@osa1 osa1 merged commit 9ffbaf2 into google:master May 17, 2022
@osa1 osa1 deleted the frozen_pblist_type branch May 17, 2022 15:22
osa1 added a commit to osa1/protobuf.dart that referenced this pull request May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants