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

          Issue ID: 12827
           Summary: DMD segfaults if the member variable has the same name
                    as the template argument
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: DMD
          Assignee: [email protected]
          Reporter: [email protected]

DMD segfaults if the member variable has the same name as the template argument

Example of code :

    struct Foo(int i)
    {
        immutable int i = i;
    }

    void main()
    {
        Foo!5 foo;
        writeln(foo);
    }

Output :

    app.d(20): Deprecation: variable app.Foo!5.Foo.i immutable field with
initializer should be static, __gshared, or an enum
    Segmentation fault (core dumped)

--

Reply via email to