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

checker: check expr evaluated but not used (fix #21436) #21816

Merged
merged 2 commits into from
Jul 8, 2024

Conversation

yuyi98
Copy link
Member

@yuyi98 yuyi98 commented Jul 7, 2024

This PR check expr evaluated but not used (fix #21436).

  • Check expr evaluated but not used.
  • Add test.
fn main() {
	{1, 2, 3, 4}
	println('works')
}

PS D:\Test\v\tt1> v run .
tt1.v:2:3: error: expression evaluated but not used
    1 | fn main() {
    2 |     {1, 2, 3, 4}
      |      ^
    3 |     println('works')
    4 | }

vlib/v/checker/checker.v Outdated Show resolved Hide resolved
@spytheman spytheman merged commit 14d378c into vlang:master Jul 8, 2024
76 checks passed
@yuyi98 yuyi98 deleted the check_expr_eval_not_used branch July 8, 2024 10:16
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.

Standalone brace block containing only literals
2 participants