fwcd / fwcd/swift-binary-coder
Investigate how to fix untagged enum serialization
- 主要言語
- Swift
- スター
- 4
- フォーク
- 1
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Since the synthesized `Encodable` implementation for enums is externally tagged by key and we discard keys during encoding, enums currently use a completely untagged representation, which can make it hard to distinguish cases during decoding.
As described [in the test case](https://github.com/fwcd/swift-binary-coder/blob/5270e91c53e2b75a32c8383de74743233d8aab7a/Tests/BinaryCoderTests/BinaryEncoderTests.swift#L36-L39), we should investigate whether non-`.untaggedAndAmbiguous` strategies should throw an error, even though there may be a runtime cost to detect whether a type is an enum (e.g. through reflection)?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。