Skip to content

Conversation

@zhaakhi
Copy link

@zhaakhi zhaakhi commented Apr 20, 2016

Swift has enumerations with associated values, which seems like a
natural representation of union structs.

This would convert a union as
union Foo {
1: Bar bar
2: Baz baz
}

into a Swift definition like

enum Foo {
case bar(Bar)
case baz(Baz)
case ThriftUnknownValue
}

WIP: untested and needs better errors in some cases.

Stig Bakken and others added 4 commits April 8, 2016 16:15
Arithmetic operators in Swift are not allowed to overflow by default.
Use overflow operators when calculating the hash value to prevent
overflow errors.
Swift has enumerations with associated values, which seems like a
natural representation of union structs.

WIP: untested and needs better errors in some cases.
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