serve-d
serve-d copied to clipboard
serve-d complains when on assignment in conditional expression
Description
Serve-d tells me that the code below should result in an Error despite it compiling fine.
Setup
- Arch Linux
- neovim 0.7.0
- nvim-lspconfig
- serve-d - latest version as of June 03 2022 (Also tested with stable 7.4v release)
Steps to reproduce
- Create a sample project with dub
- insert this code in source/app.d
import std : writeln, format;
void main()
{
int i = 10;
// Silly example I know
while (int not_four = (i != 4)) {
writeln(format("%d is not 4!", i));
i--;
}
}
this actually seems to be new syntax since 2.097.2 that you are allowed to use variable declarations as conditions inside while loops that's not yet supported in libdparse: https://dlang.org/changelog/2.097.0.html#while-condition-assignment
Should I open an issue in libdparse then?
yes, should be fixed soon too
(still needs libdparse update here)
libdparse
has been updated here already. The only thing we are missing is a release. We can close this already, no?
yep, stable release is in preparation and dependencies are updated as well