title: Swift linking error: type metadata accessor for Module.Class
body: <p>While working in <code>Swift</code> project, I have two modules, let's say </p>
  
  <ol>
  <li><code>Base</code></li>
  <li><code>Feature</code> </li>
  </ol>
  
  <p><code>Base</code> has a <code>SHService</code> class from where I am calling a function of <code>Feature</code> module (of class <code>SHCommon</code>). Feature module is building without error but <code>Base</code> raises error in linking phase.</p>
  
  <h2>Snapshot of workspace:</h2>
  
  <p><img src="https://i.stack.imgur.com/XV9vU.png" width="600" /></p>
  
  <h2>Base.SHService</h2>
  
  <pre><code>import Foundation
  import Feature
  
  class SHService {
  
      public func printMe(printString: String){
          SHCommon().printMe(printString: printString)
      }
  }
  </code></pre>
  
  <h2>Feature.SHCommon</h2>
  
  <pre><code>import Foundation
  
  public class SHCommon {
  
      public init(){}
      public func printMe(printString: String) {
          print(printString)
      }
  }
  </code></pre>
  
  <h2>Link error:</h2>
  
  <p><img src="https://i.stack.imgur.com/VJp4q.png" width="600" /></p>
  
  <p>Any idea why this is happening? </p>