supports type-safe enum