www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15422] New: Crash on nested struct

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

          Issue ID: 15422
           Summary: Crash on nested struct
           Product: D
           Version: D2
          Hardware: All
               URL: http://forum.dlang.org/post/mufvqrqgkcmkorwumgjm forum
                    .dlang.org
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dfj1esp02 sneakemail.com

class App
{
    this()
    {
    }

    void crash( int val )
    in
    {
        assert( val == 1 );
    }
    body
    {
        struct Foo
        {
            this( int k )
            {
                a = k;
            }
            int a;
        }

        Foo foo;
        int[ Foo ] map;

        map[ foo ] = 1;  // Crash
    }
}

int main()
{
    App a = new App;
    a.crash( 1 );

    return 0;
}

Works on dmd 2.064.2

--
Dec 08 2015