www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22634] New: assert for too many symbols should be error


          Issue ID: 22634
           Summary: assert for too many symbols should be error
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: tim.dlang t-online.de

void main()
    static foreach(i; 0..65537)

The above code triggers an assert in src/dmd/expressionsem.d:
assert(s.localNum);         // 65535 should be enough for anyone

I found it while reducing a different problem, so it may not be a problem in
real code, but it should be a normal error instead of an assert.

Dec 28 2021