You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
V translates the expression -(-2) into --2 in C source!
Reproduction Steps
the test
testfiles> v conv_test.v
================== C compilation error (from tcc): ==============
cc: .../AppData/Local/Temp/v_0/conv_test.01KN93ZGHHYE13ZDTMGXHT5X09.tmp.c:8144: warning: implicit declaration of function'GetFinalPathNameByHandleW'
cc: .../AppData/Local/Temp/v_0/conv_test.01KN93ZGHHYE13ZDTMGXHT5X09.tmp.c:8548: error: lvalue expected
...
cc: .../AppData/Local/Temp/v_0/conv_test.01KN93ZGHHYE13ZDTMGXHT5X09.tmp.c:8548: error: lvalue expected
(note: the original output was 9 lines long; it was truncated to its first 2 lines + the last line)
=================================================================
Try passing `-g` when compiling, to see a .v file:line information, that correlates more with the C error.
(Alternatively, pass `-show-c-output`, to print the full C error message).
builder error:
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .
Describe the bug
V translates the expression
-(-2)into--2in C source!Reproduction Steps
the test
the source
Expected Behavior
Compiling ok.
Current Behavior
Failed to compile.
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.5.1 0c3183c
Environment details (OS name and version, etc.)
Windows 10 x64.
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.