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

feat(compiler): Introduce warning if non-void expression value not used or ignored #2141

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alex-snezhko
Copy link
Member

The below code will now give a warning

let someThing = (value) => {
  if (value) {
    Ok("Good")
  } else {
    Err("Not good")
  }
}

let f = () => {
  someThing(false)
  123
}

@ospencer
Copy link
Member

Let's land this in the next breaking so users aren't surprised by the warnings.

@ospencer ospencer added this pull request to the merge queue Sep 22, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 22, 2024
@ospencer
Copy link
Member

@alex-snezhko can you rebase this? Looks like the tests are failing on merge because of the LSP tests.

@alex-snezhko
Copy link
Member Author

@ospencer rebased and fixed tests

@ospencer
Copy link
Member

@alex-snezhko looks like tests are failing because of formatting.

Copy link
Member

@marcusroberts marcusroberts left a comment

Choose a reason for hiding this comment

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

Nice improvement, I like getting these warnings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants