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

Add Option and Result variants in prelude #4504

Merged
merged 2 commits into from
Apr 28, 2023

Conversation

IGI-111
Copy link
Contributor

@IGI-111 IGI-111 commented Apr 27, 2023

Description

This also handles ambiguities in cases where a lone ident is either a variable or a variant; or a variable declaration or an enum scrutinee.

Fix #4480

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@IGI-111 IGI-111 added bug Something isn't working enhancement New feature or request lib: std Standard library compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen labels Apr 27, 2023
@IGI-111 IGI-111 requested a review from a team April 27, 2023 17:37
@IGI-111 IGI-111 self-assigned this Apr 27, 2023
@IGI-111 IGI-111 force-pushed the IGI-111/option-and-result-in-prelude branch from fd99fd4 to 58a3d3d Compare April 27, 2023 17:59
@IGI-111 IGI-111 marked this pull request as ready for review April 27, 2023 18:11
Copy link
Contributor

@calldelegation calldelegation left a comment

Choose a reason for hiding this comment

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

Looks good to me just one thing. Can you update the prelude.md as well to include Option and Result now.

@IGI-111 IGI-111 force-pushed the IGI-111/option-and-result-in-prelude branch from 58a3d3d to e556680 Compare April 27, 2023 23:18
@IGI-111
Copy link
Contributor Author

IGI-111 commented Apr 27, 2023

The types were already in there but I updated it to clarify that we also include the variants.

This also handles ambiguities in cases where a lone ident is either
a variable or a variant; or a variable declaration or an enum scrutinee.

Fix #4480
@IGI-111 IGI-111 force-pushed the IGI-111/option-and-result-in-prelude branch from e556680 to f0f854b Compare April 27, 2023 23:20
@IGI-111 IGI-111 requested review from calldelegation and a team April 27, 2023 23:20
Copy link
Contributor

@esdrubal esdrubal left a comment

Choose a reason for hiding this comment

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

LGTM.

@esdrubal esdrubal enabled auto-merge (squash) April 28, 2023 09:43
@esdrubal esdrubal merged commit 6a3fba1 into master Apr 28, 2023
21 checks passed
@esdrubal esdrubal deleted the IGI-111/option-and-result-in-prelude branch April 28, 2023 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen enhancement New feature or request lib: std Standard library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Option::Some, Option::None, Result::Ok, and Result::Err to the prelulde
4 participants