I have this in a class: enum ActorType:ubyte {Unit=0, Building=1, Other=2 } then, class Actor { this() { assert(this.getType()<5); //THIS FAILS } (...) public final ActorType type=ActorType.Other; protected ubyte getType() { return cast(ubyte)type; } } In a static constructor, an Actor is created to test another class, and the program ends in an assert error.