Better validation at compile time would benefit many types, not just those expressible by integer literals. The groundwork is being laid for this with compile-time constant expressions.
Once built out, one imagines that a @compilerEvaluable
precondition would get you the diagnostics you want.
See also: