www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14123] New: cannot compare typeid(object.Object) at compile

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

          Issue ID: 14123
           Summary: cannot compare typeid(object.Object) at compile time
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: CTFE
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: nilsbossung googlemail.com
            Blocks: 7151

---
cat > test.d << code
static assert({
    auto o = new Object;
    return typeid(o) is typeid(o); /* line 3 */
}());
code
dmd -c test.d
---
test.d(3): Error: cannot compare typeid(object.Object) at compile time
test.d(4):        called from here: (*() => **o is **o)()
test.d(1):        while evaluating: static assert((*() => **o is **o)())
---

--
Feb 04 2015