Skip to content

Simplify protobuf compiler default field values#1543

Merged
paracycle merged 1 commit intomainfrom
uk-fix-protobuf-defaults
Jun 23, 2023
Merged

Simplify protobuf compiler default field values#1543
paracycle merged 1 commit intomainfrom
uk-fix-protobuf-defaults

Conversation

@paracycle
Copy link
Copy Markdown
Member

Motivation

There is no point in trying to construct elaborate default values for the initializer fields, since in the RBI file, the default value is meaningless. What matters is the type of the field and if the field is optional or not. Thus, we can easily simplify the code and generate default values as T.unsafe(nil).

Implementation

Change default values to T.unsafe(nil).

Tests

Updated existing tests.

The no point in trying to construct elaborate default values for
the initializer fields, since in the RBI file, the default value is meaningless. What matters is the type of the field and if the field is optional or not. Thus, we can easily simplify the code and generate default values as `T.unsafe(nil)`.
@paracycle paracycle added the enhancement New feature or request label Jun 23, 2023
@paracycle paracycle requested a review from bitwise-aiden June 23, 2023 18:04
@paracycle paracycle requested a review from a team as a code owner June 23, 2023 18:04
@paracycle paracycle requested a review from egiurleo June 23, 2023 18:04
@paracycle paracycle merged commit 40d89a2 into main Jun 23, 2023
@paracycle paracycle deleted the uk-fix-protobuf-defaults branch June 23, 2023 20:49
@shopify-shipit shopify-shipit Bot temporarily deployed to production July 12, 2023 18:26 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants