Last active
August 29, 2015 14:28
-
-
Save hyperspacemark/3e5b1d67995365d27e81 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class Controller: A { | |
var property: String = "" { | |
didSet { | |
for a in collectionOfA { | |
// Cannot assign to property: 'a' is a 'let' constant | |
a.property = property | |
} | |
} | |
} | |
var collectionOfA: [A] = [] | |
} | |
// This protocol declaration causes the error to be thrown... | |
protocol A { | |
var property: String { get set } | |
} | |
// ...but marking it as a `class` protocol results in no error being raised. | |
protocol A: class { | |
var property: String { get set } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment