Thread overview
[Issue 19411] Visual D Intellisense chokes on static ifs
December 06

Rainer Schuetze <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #1 from Rainer Schuetze <> ---
I just tried to reproduce this with a series of more than 2000 "static if(size_t.sizeof == 4) {}", but didn't see a problem. Also using "else static if" worked alright.

Maybe this has been fixed with the latest release, but I suspect this might have to do with some analysis taking too long, that isn't done when using regular "if" only.

Could you please check again and try to reduce the code to a amaller size or attach the full example? Thanks.

December 06

--- Comment #2 from John Chapman <> ---
Created attachment 1719
Code to repro issue 19411

December 06

--- Comment #3 from John Chapman <> ---
I tried again with version 0.48.0 and it still happens. In fact it's now occuring with regular "if"s as well. I've attached code that triggers this.

I checked my error logs and whenever this happens DParserCOMServer.exe appears with exception code 0xc00000fd - System.StackOverflowException.

December 07

--- Comment #4 from Rainer Schuetze <> ---
Thanks. It's a builtin limitation of the recursive descend parser because the if/else-series creates a deep tree of AST nodes. Even if optimized in the parser the same problem will appear during analysis.

I will increase the stack size to 8 MB, similar to dmd. dmd also chokes at some point, e.g.

module mod;

string genIfElse(int n)
        string s = "if(size_t.sizeof == 4) {}\n";
        foreach(i; 0..n)
                s ~= "else if(size_t.sizeof == 4) {}";
        return s;
void test()