You can use any ExpressibleByIntegerLiteral (or StringLiteral) as an enum’s raw type, or you can implement RawRepresentable yourself. But for non-@objc enums, having the constants inline is only shorthand for the two switch statements that appear in RawRepresentable’s requirements, it has no other effect. I’m not saying it’s not nice shorthand, but there’s nothing special going on here.
EDIT: so if you could have your cake and eat it too, what would the rule actually be? What code turns 0xC2_000000 into an Int32?
the issue with that is that you need to keep the rawValue and the init(rawValue:) sides in sync with one another.
the rule would be the extension TagBits:RawRepresentable block in my original post. the justification is that RawRepresentable and its requirements are meant to work with generics (especially other protocols), but the literal constants are just there to provide a consistent mapping. so the mapping logic should go through init(literalValue:) and literalValue instead of piggybacking on RawRepresentable.