3 ms·
In Swift, String? is an alias to Optional<String>. Optional is an enumeration with two cases: some, and none, where the former has the non-nil value attached. I
by manmal 2y ago
In Swift, String? is an alias to Optional<String>. Optional is an enumeration with two cases: some, and none, where the former has the non-nil value attached. I‘m not sure how that ties in with subtyping though.
- ackfoobar 2y ago> how that ties in with subtyping In Swift it does not. But in Kotlin, `String?` is not an enum (sum type), but instead means `String | null`, a union type.