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

In the case of an optional it can be initialised to nil (and it will be implicitly).

Swift can tell from static analysis if it might be read at compile time and raise an issue if it isn't initialised on all oaths to the access. If passed as an inout parameter it has to assume it may be read[0] and for safety require that it must be initialised.

[0] at least if it is calling into a library even if it can check the current version it couldn't know for sure that a different library version won't behave differently.



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

Search: