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

pkg/parsers/zero: improve Identifiers typing #195

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

quasilyte
Copy link
Contributor

This allows us to do less redundant type assertions while handling the zero prog identifiers.

We may go even further, but this step is enough for now to make zero hints handler less awkward.

The .([]zero.Reference) assertion was not working as the slice contained []any instead.
Instead of rewriting the code to handle even more
weakly typed any values, this patch improves the Identifier objects typing.
This makes type assertions and slice conversions unnecessary.

This allows us to do less redundant type assertions
while handling the zero prog identifiers.

We may go even further, but this step is enough for now
to make zero hints handler less awkward.

The `.([]zero.Reference)` assertion was not working as
the slice contained `[]any` instead.
Instead of rewriting the code to handle even more
weakly typed `any` values, this patch improves the
Identifier objects typing.
This makes type assertions and slice conversions unnecessary.
Copy link
Contributor

@cicr99 cicr99 left a comment

Choose a reason for hiding this comment

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

LGTM

@cicr99 cicr99 merged commit 2c7509b into main Feb 1, 2024
4 checks passed
@cicr99 cicr99 deleted the quasilyte_improve_zero_identifiers_typing branch February 1, 2024 10:38
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