-
Notifications
You must be signed in to change notification settings - Fork 197
Hide PbList and PbMap constructors #1072
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
base: master
Are you sure you want to change the base?
Conversation
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
| returnsNormally, | ||
| reason: 'could not add min Int64 to a PbList', | ||
| ); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed because we no longer have access to PbList. We could test these using generated messages (by moving the test to protoc_plugin/test), but we already test the same things in https://github.com/google/protobuf.dart/blob/master/protoc_plugin/test/validate_fail_test.dart so these are also redundant.
|
(Waiting to test this internally after cl/825440440) |
PbListandPbMapcan't be constructed by the users properly, because theconstructor arguments are private:
PbListelement check functionPbMapkey and value field type argumentsInternally we had just one
PbMapconstructor call (with random field typearguments) which we replaced with
{}, and a fewPbListconstructor calls(without a check function) which we replaced with
[].To prevent confusion and incorrect uses of these types, hide the constructors.
Some of the
PbListelement validation tests are removed: they would need tobe moved to
protoc_plugin/testas we no longer have access toPbListconstructors (but we can get
PbLists from messages), but the tests are alsoduplicates of the tests in
protoc_plugin/test/validate_fail_test.dart. Soremoved them instead.