You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Protocols currently support functions and variables. The use of a let in a protocol leads to LLVM suggesting use of a var with a get, however this is not equivalent. A synthetic variable with a getter can change over time whereas a let cannot, and each has different implications. This restrictions feels like leftovers from Objective-C protocols.
It would be useful to allow constants in protocols!
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: b10bcaf85d0a621527517f80bf2cbfc4
Issue Description:
Protocols currently support functions and variables. The use of a let in a protocol leads to LLVM suggesting use of a var with a get, however this is not equivalent. A synthetic variable with a getter can change over time whereas a let cannot, and each has different implications. This restrictions feels like leftovers from Objective-C protocols.
It would be useful to allow constants in protocols!
The text was updated successfully, but these errors were encountered: