[Bug 191] internal error when nesting class and recursive calls

via D.gnu d.gnu at puremagic.com
Sat Jul 4 03:25:09 PDT 2015


http://bugzilla.gdcproject.org/show_bug.cgi?id=191

--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject.org> ---
Extending from the original PR, there are another two tests to consider (which
shows why it gets complicated).

class OuterClass
{
  void recurse()
  {
    class InnerClass
    {
      void test()
      {
        void localFunction()
        {
          void anotherLocalFunction()
          {
            recurse();   // Ensure we handle Nth depth.
          }

          anotherLocalFunction();
        }

        localFunction();
      }
    }
  }
}


class OuterClass
{
  void recurse()
  {
    class InnerClass
    {
      void test()
      {
        void localFunction()
        {
          int a = 42;

          void anotherLocalFunction()
          {
            a++;       // And correctly handle any
                       // static chains along the way.
            recurse();
          }

          anotherLocalFunction();
        }

        localFunction();
      }
    }
  }
}

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20150704/1a7ab0d7/attachment.html>


More information about the D.gnu mailing list