Pure-D / serve-d

D LSP server (dlang language server protocol server)
MIT License
200 stars 48 forks source link

serve-d complains when on assignment in conditional expression #228

Closed vabenil closed 1 year ago

vabenil commented 2 years ago

Description

Serve-d tells me that the code below should result in an Error despite it compiling fine. 2022-06-03_10:55:50

Setup

Steps to reproduce

  1. Create a sample project with dub
  2. 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--; } }

WebFreak001 commented 2 years ago

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

vabenil commented 2 years ago

Should I open an issue in libdparse then?

WebFreak001 commented 2 years ago

yes, should be fixed soon too

WebFreak001 commented 2 years ago

(still needs libdparse update here)

vabenil commented 1 year ago

libdparse has been updated here already. The only thing we are missing is a release. We can close this already, no?

WebFreak001 commented 1 year ago

yep, stable release is in preparation and dependencies are updated as well