Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is Swift, where Type? is syntax sugar for Optional<Type>. Swift's Optional is a standard sum type, with a lot of syntax sugar and compiler niceties to make common cases easier and nicer to work with.


Right, so it's not like a union type Type | Null. Then naturally it works the same way as in the languages I listed.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: