[Issue 9671] [CTFE] Class object cannot compare in compile time

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 9 06:29:21 PST 2013


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


Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Getting class object typeid |[CTFE] Class object cannot
                   |in CTFE is not supported    |compare in compile time


--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2013-03-09 06:29:20 PST ---
Add more general test case, and change the summary.

----
bool test()
{
    class Class {}

    Object c = new Class;
    Object o = new Object;
    return c != o;     // line 7
}
void main() { assert(test()); } // pass
static assert(test()); // line 10


output:
----
test.d(7): Error: opEquals cannot be interpreted at compile time, because it
has no available source code
test.d(10):        called from here: test()
test.d(10):        while evaluating: static assert(test())

-- 
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