fwcd / fwcd/swift-binary-coder

Investigate how to fix untagged enum serialization

Abierto
#3 0 comentarios 0 reacciones 0 asignados Ver en GitHub
help wanted
Lenguaje dominante
Swift
Estrellas
4
Forks
1
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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)?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.