[Issue 14610] New: 'null this' assertion missing in 2.067

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue May 19 23:27:58 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14610

          Issue ID: 14610
           Summary: 'null this' assertion missing in 2.067
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: tomerfiliba at gmail.com

Consider the following code:

==================================
struct S {
    void foo() {}
}

void main() {
    S* s = null;
    s.foo();
}
==================================

It used to crash with "null this", e.g., 

core.exception.AssertError at main.d(2): null this

but as of 2.067 it crashes with 

core.exception.AssertError at source/main.d(0): Assertion failure

So first of all, the message is undescriptive, and second, the line number is
0, which is very weird.

--


More information about the Digitalmars-d-bugs mailing list