Several posts here mentioned how Mirror can get the full name parts of enumeration cases with payloads, but those techniques don't work for singular cases. Yes, enum types can automatically provide String renditions, but (AIUI) only as automated. That automated code disappears if you add LosslessStringConvertible conformance. There are other methods, but their implementations call that automatic code. So is there an automated way to generate enum case stings independent of the automatically-defined description code?
Maybe _getEnumCaseName?
Like this:
@_silgen_name("swift_EnumCaseName")
internal func _getEnumCaseName<T>(_ value: T) -> UnsafePointer<CChar>?
enum E {
case one
case two
case three
}
print(
String(cString: _getEnumCaseName(E.one)!)
)