title: iOS Swift4 how to protect computed property defined in interface from assignment?
body: <p>I'm debugging some poorly written unit tests for a class from a legacy code base I inherited. I see that the developer is not testing the computed property correctly. I want to understand how to enforce my <code>userEnabledFeature</code> to be read only in the Fake class. </p>
  
  <p><strong>Why class implementing protocol with computed property can overwrite the computed property and make it writable?</strong></p>
  
  <pre><code>public protocol FeatureManager {
      var userEnabledFeature : Bool { get }
  }
  
  public class FakeFeatureManagerForTesting: FeatureManager {
      public var userEnabledFeature = false //is this legal? Why is compiler not complaining?
  
      public func updateUserEnabledFeature(enabled: Bool){
          //this should not be possible - how do I prevent overwriting computed property?
          userEnabledFeature = enabled
      }
  }
  
  ActualFeatureManagerClass {
      public var userEnabledFeature: Bool {
          if featureManager.cachedFeatures.filter { $0.enabled == true}
          {
              //do more checks, return true or false
          }
          return false //default
      }
  }
  </code></pre>