swift
d7d36086 - Break cyclic dependency due to implicit initialization of optional values

Commit
2 years ago
Break cyclic dependency due to implicit initialization of optional values The fundamental problem here is that we don't know a priori whether an accessor macro will convert a stored property into a computed one. That can only be determined after macro expansion, which depends on having a determined type for the property. Implicit initialization of optional-typed values (e.g., "var birthDate: Date?") adds the initializer when there is storage, triggering the cycle. Introduce a very narrow fix that assumes that properties that have an accessor macro on them do not have storage. We probably want to enforce this, so that the "does this variable have storage?" query can be made cheaper.
Author
Parents
Loading