title: @import X; Causes error Could not build module X
body: <p>I have a custom framework TSUI defined as a module. It has both Objective-C and Swift code. If I import it in Objective-C code as follows:</p>
  
  <pre><code>#import &lt;TSUI/TSUI.h&gt;
  </code></pre>
  
  <p>Everything works just fine, but then I get only access to the Objective-C code. However, if I import it as:</p>
  
  <pre><code>@import TSUI;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>#import &lt;TSUI/TSUI.h&gt;
  #import &lt;TSUI/TSUI-Swift.h&gt;
  </code></pre>
  
  <p>Everything compiles fine, but in Xcode I get the following error:
  <a href="https://i.stack.imgur.com/6C744.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6C744.png" alt="enter image description here"></a></p>
  
  <p>In both the framework and the app code I've set the following build settings:</p>
  
  <ul>
  <li>Embedded content contains Swift code = YES</li>
  <li>Allow Non-Modular Includes In Framework Modules = YES</li>
  <li>Enable Modules = YES</li>
  </ul>
  
  <p>I've tried cleaning the project, cleaning the derived data, and the issue keeps coming back. It also appears if the framework contains no Swift code but is included with @import instead of #import. At the moment I would consider it to be a bug.</p>