Bug after local import statement?

berni someone at somemail.de
Wed Mar 7 12:49:30 UTC 2018


The following code compiles with ldc/dmd but not with gdc:

> cat test.d
void main()
{
     int[] count;

     {
         import std.string;

         ++count[3];
     }
}

> gdc test.d
test.d:8:16: error: only one index allowed to index void
          ++count[3];
            ^

> gdc --version
gdc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  
There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE.

Is this a bug?


More information about the D.gnu mailing list