We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A logical AND (&&) with an intentional order of conditional statements could behave the same creating deeper nesting levels.
import semver version := 'nightly' if version != 'nightly' && semver.from(version)! < semver.from('2.4.1')! { } else { // condition }
Result: version != 'nightly is checked, still getting the error:
version != 'nightly
V panic: result not set (Invalid version format for input "nightly")
Same as using a nested conditon:
import semver version := 'nightly' if version != 'nightly' { if semver.from(version)! < semver.from('2.4.1')! { } else { // condition } } else { // same else condition }
Result: Won't error
No response
👇
V full version: V 0.4.6 09eaae5 OS: linux, "EndeavourOS Linux" Processor: 16 cpus, 64bit, little endian, 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz getwd: /home/t/Nextcloud/Dev/vlang/playground vexe: /home/t/Nextcloud/Dev/vlang/v/v vexe mtime: 2024-05-28 18:24:11 vroot: OK, value: /home/t/Nextcloud/Dev/vlang/v VMODULES: OK, value: /home/t/.vmodules VTMP: OK, value: /tmp/v_1000 Git version: git version 2.45.1 Git vroot status: weekly.2024.22-4-g09eaae5f .git/config present: true CC version: cc (GCC) 14.1.1 20240522 thirdparty/tcc status: thirdparty-linux-amd64 40e5cbb5
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote. Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered:
The evaluation order is not defined currently.
Sorry, something went wrong.
The same problem is demonstrated by this program, that does not need semver:
semver
fn f(s string) !int { if s == '' { return error('invalid s') } return s.len } v := '' x := v != 'xyz' && f(v)! < f('abc')! dump(x)
It might work to just cgen the nesting if there is a function expression in a condition.
No branches or pull requests
Describe the bug
A logical AND (&&) with an intentional order of conditional statements could behave the same creating deeper nesting levels.
Reproduction Steps
Result:
version != 'nightly
is checked, still getting the error:Expected Behavior
Same as using a nested conditon:
Result:
Won't error
Current Behavior
Possible Solution
No response
Additional Information/Context
No response
V version
👇
Environment details (OS name and version, etc.)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: