[Issue 7147] [CTFE] typeid() should be supported in CTFE

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Feb 4 04:00:58 PST 2015


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

Nils <nilsbossung at googlemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nilsbossung at googlemail.com
             Blocks|                            |7151

--- Comment #4 from Nils <nilsbossung at googlemail.com> ---
(In reply to Rainer Schuetze from comment #3)
> struct S { }
> static assert(typeid(S).init.length > 0);

Now gives: "Error: static variable typeid(S) cannot be read at compile time".

Same error when trying to call typeid(object.Object).opEquals:

---
static assert(typeid(new Object).opEquals(typeid(new Object)));
---
Error: static variable typeid(object.Object) cannot be read at compile time
---

This blocks 7151.

> class C {}
> static assert(typeid(C).init.length > 0);

Now gives: "Error: typeid(test.C).init is not yet implemented at compile time".

--


More information about the Digitalmars-d-bugs mailing list