https://dpaste.dzfl.pl/082f070327f5
import std.stdio;
class T {};
void main() {
T foo;
switch (typeid(foo).hashOf) {
case T.classinfo.hashOf :
writeln(`foo isa T`);
break;
default : break;
};
};
segfault with DMD v2.071.1
(In reply to Cauterite from comment #1)
> actually this is a much better example:
> https://dpaste.dzfl.pl/01e323e77dac
>
> class T {};
> enum x = T.classinfo.hashOf;
(In reply to Ketmar Dark from comment #2)
> seems to be fixed in master. confirm anyone?
Can confirm. 2.071.1 segfaults. Git head (v2.072.0-devel-b0bc2f4) doesn't segfault, but prints an error: "object.d(3173): Error: pointer & arg cannot be sliced at compile time (it does not point to an array)".
Comment #4 by ketmar — 2016-07-25T15:12:32Z
yes, error is expected, as you can't do pointer math in CTFE. thank you.