Skip to content

Conversation

@sinzii
Copy link
Member

@sinzii sinzii commented Apr 14, 2025

Known issue: Ambiguity in binary representation between different option states.

When encoding nested options:

  • None → [0]
  • Some(None) → [1, 0]
  • Some(Some(value)) → [1, 1, value]

The problem is that when decoding [1, 0] back to a value, the inner option returns none, making it potentially indistinguishable from the outer option being None in some contexts.

This can cause cross-language compatibility issues and encoding/decoding inconsistencies.


For now, I think we can live with this.

@sinzii sinzii merged commit f4ffb15 into main Apr 15, 2025
2 checks passed
@sinzii sinzii deleted the fix/nested-option branch April 15, 2025 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants