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

Consider making CompileResult members private. #2475

Open
otrho opened this issue Aug 8, 2022 · 0 comments
Open

Consider making CompileResult members private. #2475

otrho opened this issue Aug 8, 2022 · 0 comments
Labels
code quality compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen enhancement New feature or request good first issue Good for newcomers P: medium

Comments

@otrho
Copy link
Contributor

otrho commented Aug 8, 2022

When reviewing #2472 I noticed it's possible to accidentally make an invalid CompileResult, where the author intended to return an 'ok' but set value to None.

We should make it mandatory to use CompileResult::ok() and CompileResult::err() to avoid this sort of thing. It would also required making a bunch of access methods for pulling the value or errors and/or warnings out which may turn out to be quite a pervasive change.

@otrho otrho added enhancement New feature or request good first issue Good for newcomers code quality P: medium compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen labels Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen enhancement New feature or request good first issue Good for newcomers P: medium
Projects
None yet
Development

No branches or pull requests

1 participant