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: fix missing or-block check for callexpr #22840

Merged
merged 31 commits into from
Nov 13, 2024

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Nov 12, 2024

@felipensp felipensp marked this pull request as ready for review November 12, 2024 14:23
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Good work.

Comment on lines +1 to +35
vlib/v/checker/tests/call_empty_or_block_err.vv:9:2: warning: unused variable: `a`
7 |
8 | fn main() {
9 | a := foo() or { foo() or {} }
| ^
10 |
11 | // must be error
vlib/v/checker/tests/call_empty_or_block_err.vv:12:2: warning: unused variable: `y`
10 |
11 | // must be error
12 | y := if c := foo() {
| ^
13 | dump(c)
14 | bar() or {}
vlib/v/checker/tests/call_empty_or_block_err.vv:20:2: warning: unused variable: `z`
18 |
19 | // ok
20 | z := if d := foo() {
| ^
21 | dump(d)
22 | bar() or {}
vlib/v/checker/tests/call_empty_or_block_err.vv:29:2: warning: unused variable: `w`
27 |
28 | // ok
29 | w := foo() or {
| ^
30 | bar() or {}
31 | false
vlib/v/checker/tests/call_empty_or_block_err.vv:35:2: warning: unused variable: `b`
33 |
34 | // ok
35 | b := foo() or {
| ^
36 | foo() or {}
37 | false
Copy link
Member

Choose a reason for hiding this comment

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

imho just add dump(a), dump(b) etc at the end to silence the warnings - they are not essential to the fix

@spytheman spytheman merged commit 62bdf99 into vlang:master Nov 13, 2024
71 checks passed
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.

cgen error for Sumtype( f() or { variant_value } )
2 participants