[Issue 1324] New: Wrong module name in exception when using mixin

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 9 05:07:10 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1324

           Summary: Wrong module name in exception when using mixin
           Product: D
           Version: 1.018
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: vlasov at scatt.com
 BugsThisDependsOn: 107


Wrong module name (but right line number) in exception if it
occurred in mixin from another module.


--- output ---
catched exception in t2.d: 'ArrayBoundsError t1(13)'
catched exception in t1.d: 'ArrayBoundsError t1(10)'


--- file t1.d ---
module t1;
import t2;

void main()
{
        mixin mixinT2;
        testT2(1);
        int i = 2;
        try {
          arr[i] = i;
  }
  catch(Exception e)
  {
          writefln("catched exception in %s: '%s'", __FILE__, e.toString);
  }
}


--- file t2.d ---
module t2;


template mixinT2()
{
  import std.stdio;

  int[1] arr;

  void testT2(int i)
  {
                try {
                  arr[i] = i;
                }
                catch(Exception e)
                {
                  writefln("catched exception in %s: '%s'", __FILE__,
e.toString);
                }
  }
}


-- 



More information about the Digitalmars-d-bugs mailing list