www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1324] New: Wrong module name in exception when using mixin

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 digitalmars.com
        ReportedBy: vlasov 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);
                }
  }
}


-- 
Jul 09 2007