www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16051] New: ICE with nested functions and template alias


          Issue ID: 16051
           Summary: ICE with nested functions and template alias parameter
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: ice, ice-on-valid-code
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla kyllingen.net

Test case:

    void fun(alias a)()
        auto dg = () {
            void gun() { }

    void main()
        void hun(R)(R) { }

This results in the following ICE:

    dmd: toir.c:249: elem* getEthis(Loc, IRState*, Dsymbol*): Assertion
`thisfd->isNested() || thisfd->vthis' failed.

This is possibly a duplicate of issue #12839, as it apparently causes the same
assertion to fail, but I'm not sure.  The test case seems different enough that
I decided to open a new bug report for it.

May 21 2016