Bug or not? Statics inside blocks

ag0aep6g via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 28 22:36:21 PDT 2017


On 07/29/2017 03:54 AM, Cecil Ward wrote:
> Is it my bug, or a compiler bug? (name clash at link-time?):
> 
> void main()
>      {
>          {
>          immutable static dstring str1 = "a";
>          }
>          {
>          immutable static dstring str1 = "b";
>          }
>      }

https://issues.dlang.org/show_bug.cgi?id=11720

Ideally (imo), the code would work. The two variables would need 
different mangled names. No idea how hard that would be to implement.


More information about the Digitalmars-d-learn mailing list