diff --git a/import/object.di b/import/object.di index 36d86f64b29..069e2acb889 100644 --- a/import/object.di +++ b/import/object.di @@ -323,8 +323,8 @@ class Exception : Throwable class Error : Throwable { - this(string msg, Throwable next, string file = __FILE__, size_t line = __LINE__); - this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null); + this(string msg, Throwable next = null); + this(string msg, string file, size_t line, Throwable next = null); Throwable bypassedException; } diff --git a/src/object_.d b/src/object_.d index 4e9f8a7b428..53b95b3c96b 100644 --- a/src/object_.d +++ b/src/object_.d @@ -1364,13 +1364,13 @@ unittest class Error : Throwable { - this(string msg, Throwable next, string file = __FILE__, size_t line = __LINE__) + this(string msg, Throwable next = null) { - super(msg, file, line, next); + super(msg, next); bypassedException = null; } - this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) + this(string msg, string file, size_t line, Throwable next = null) { super(msg, file, line, next); bypassedException = null; @@ -1385,17 +1385,17 @@ unittest { { auto e = new Error("msg"); - assert(e.file == __FILE__); - assert(e.line == __LINE__ - 2); + assert(e.file is null); + assert(e.line == 0); assert(e.next is null); assert(e.msg == "msg"); assert(e.bypassedException is null); } { - auto e = new Error("msg", new Exception("It's an Excepton!"), "hello", 42); - assert(e.file == "hello"); - assert(e.line == 42); + auto e = new Error("msg", new Exception("It's an Excepton!")); + assert(e.file is null); + assert(e.line == 0); assert(e.next !is null); assert(e.msg == "msg"); assert(e.bypassedException is null);