Swift- variable not initialized before use (but it's not used)
Currently I've got some swift code like this: class C { let type: Type; var num = 0; init() { self.type = Type({ (num: Int) -> Void in self.num = num; }); } } The Swift compiler refuses to permit it, saying that I've referenced self.type before it's initialized, even though that's clearly completely untrue. Furthermore, I can't employ the workaround found in other questions/answers, because the type is not optional, and it's immutable, so it can't be initialized with nil pointlessly first. How can I make the Swift compiler accept this perfectly valid code? This has nothing to do with returning