[Issue 11049] New: RangeError does not recognize file name modified by #line directive

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 15 22:45:11 PDT 2013


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

           Summary: RangeError does not recognize file name modified by
                    #line directive
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-09-15 22:45:05 PDT ---
This test case cannot pass assertions.

void main()
{
    int[] arr = [1,2,3];

#line 100 "foo"
    try { auto n = arr[3]; }
    catch (Error e)
    {
        assert(e.file == "foo");  // fails
        assert(e.line == 100);
    }

#line 200 "bar"
    try { auto a = arr[3..9]; }
    catch (Error e)
    {
        assert(e.file == "bar");  // fails
        assert(e.line == 200);
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list