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: Remove type information discarding. #332

Merged
merged 2 commits into from
Jul 23, 2021

Conversation

yeldiRium
Copy link
Contributor

@yeldiRium yeldiRium commented Jul 23, 2021

This PR:

  • adds tests regarding our assumptions for type narrowing. If i do if (result.hasError()) {} I expect result to contain a value after the if branch (assuming the if branch returns the function). This was not the case in the previous version but always assumed behavior
  • removes the type information discarding feature from ~2 versions ago, where checking if something contains an error would discard type information about the value case for more convenient early returns. this lead to probably unfixable type collisions. I would love to fix them without removing the feature, but currently it doesn't seem feasible

Hannes Leutloff added 2 commits July 23, 2021 09:06
This lead to probably unfixable type collisions, so the feature must go.
@goloroden goloroden merged commit bfa3e56 into main Jul 23, 2021
@goloroden goloroden deleted the fix/remove-type-information-discarding branch July 23, 2021 11:34
goloroden pushed a commit that referenced this pull request Jul 23, 2021
## [7.3.2](7.3.1...7.3.2) (2021-07-23)

### Bug Fixes

* Remove type information discarding. ([#332](#332)) ([bfa3e56](bfa3e56))
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.

4 participants