title: Declare trivial protocol conformance for struct in a framework
body: <p>Is it possible to declare that struct a struct, defined in a framework, trivially conforms to a protocol, defined in my app?</p>
  
  <p>Say, for example, I have an API that declares structs for a few widgets modelled in a framework:</p>
  
  <pre><code>public struct VagueWidget {
      public let temperature: Float
  }
  
  public struct SpecificWidget {
      public let calibratedTemperature: Float
      public let movingAverageTemperature: Float
  }
  
  public struct SuperSpecificWidget {
      public let surfaceTemperature: Float
      public let inferredCoreTemperature: Int?
  }
  </code></pre>
  
  <p>And then in my application I want to generalise these by way of a protocol. </p>
  
  <pre><code>protocol Widget {
      var temperature: Float { get }
  }
  </code></pre>
  
  <p>In my application I can declare structs similar to those in the API, and trivially declare them as conforming to the protocol.</p>
  
  <pre><code>struct MockWidget {
      let temperature: Float
  }
  
  extension MockWidget: Widget {}
  </code></pre>
  
  <p>And then I can declare protocol conformance for the structs in the framework.</p>
  
  <pre><code>extension SuperSpecificWidget: Widget {
      var temperature: Float {
          get {
              return surfaceTemperature
          }
      }
  }
  
  extension SpecificWidget: Widget {
      var temperature: Float {
          get {
              return calibratedTemperature
          }
      }
  }
  
  extension VagueWidget: Widget {}
  </code></pre>
  
  <p>This code compiles, but doesn't link. The trivially conforming <code>VagueWidget</code> in the framework which is equivalent to the <code>MockWidget</code> in the application results in a missing symbol:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "WidgetAPI.VagueWidget.temperature.getter : Swift.Float", referenced from:
     protocol witness for WidgetApp.Widget.temperature.getter : Swift.Float in conformance WidgetAPI.VagueWidget : WidgetApp.Widget in WidgetApp in AppModel.o
  </code></pre>
  
  <p>Commenting out the trivial protocol conformance for the <code>VagueWidget</code> produces code that compiles and runs, but obviously missing the desired protocol conformance. I've added an <a href="https://github.com/blackp/WidgetApp" rel="nofollow">example project</a> on github.</p>
  
  <p><strong>Update:</strong> This appears to be a known issue. I have filed a radar, and it was closed as a duplicate of <a href="http://www.openradar.appspot.com/20648441" rel="nofollow">20648441</a>.</p>