<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">nightly (1.9.0-dev.20160502)</p>
<p dir="auto"><strong>Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// ext1.d.ts
declare module &quot;State&quot; {
    interface IState {
        num: number;
    }
    export { IState };
}

// ext2.d.ts
declare module &quot;State&quot; {
    interface IState {
        str: string;
    }
    export { IState };
}

//app.ts
import { IState } from &quot;State&quot;;

function test(state: IState): void {
    console.log(state.num);
    console.log(state.str);
}

// tsconfig.json
{
    &quot;files&quot;: [
        &quot;app.ts&quot;,
        &quot;ext1.d.ts&quot;,
        &quot;ext2.d.ts&quot;
    ]
}"><pre class="notranslate"><span class="pl-c">// ext1.d.ts</span>
<span class="pl-k">declare</span> module <span class="pl-s">"State"</span> <span class="pl-kos">{</span>
    <span class="pl-k">interface</span> <span class="pl-smi">IState</span> <span class="pl-kos">{</span>
        <span class="pl-c1">num</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-k">export</span> <span class="pl-kos">{</span> <span class="pl-smi">IState</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-c">// ext2.d.ts</span>
<span class="pl-k">declare</span> module <span class="pl-s">"State"</span> <span class="pl-kos">{</span>
    <span class="pl-k">interface</span> <span class="pl-smi">IState</span> <span class="pl-kos">{</span>
        <span class="pl-c1">str</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-k">export</span> <span class="pl-kos">{</span> <span class="pl-smi">IState</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-c">//app.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">IState</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"State"</span><span class="pl-kos">;</span>

<span class="pl-k">function</span> <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s1">state</span>: <span class="pl-smi">IState</span><span class="pl-kos">)</span>: <span class="pl-smi"><span class="pl-k">void</span></span> <span class="pl-kos">{</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">state</span><span class="pl-kos">.</span><span class="pl-c1">num</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">state</span><span class="pl-kos">.</span><span class="pl-c1">str</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-c">// tsconfig.json</span>
<span class="pl-kos">{</span>
    <span class="pl-s">"files"</span>: <span class="pl-kos">[</span>
        <span class="pl-s">"app.ts"</span><span class="pl-kos">,</span>
        <span class="pl-s">"ext1.d.ts"</span><span class="pl-kos">,</span>
        <span class="pl-s">"ext2.d.ts"</span>
    <span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong><br>
The "State" module and IState interface declarations should be merged and the code should compile without errors.</p>
<p dir="auto"><strong>Actual behavior:</strong><br>
The declaration files report error <code class="notranslate">TS2300: Duplicate identifier 'IState'</code></p>
<p dir="auto"><strong>Workaround:</strong><br>
The above errors do not occur when both IState interfaces are exported inline using the export modifier instead of in a ExportClause.<br>
NOTE: If the first is exported inline and the second is exported in an ExportClause then the second declaration errors with <code class="notranslate">TS2482: Export declaration conflicts with exported declaration of 'IState'</code>.</p>
<p dir="auto">Randomly during build, the typescript compiler will issue such errors while the class does actually have the property set as static:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class MyClass
{
    static MyProp:string=&quot;Hello&quot;;
    static MyFunc()
    {
       console.log(MyClass.MyProp);
    }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-smi">MyClass</span>
<span class="pl-kos">{</span>
    <span class="pl-k">static</span> <span class="pl-c1">MyProp</span>:<span class="pl-smi">string</span><span class="pl-c1">=</span><span class="pl-s">"Hello"</span><span class="pl-kos">;</span>
    <span class="pl-k">static</span> <span class="pl-en">MyFunc</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
    <span class="pl-kos">{</span>
       <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-smi">MyClass</span><span class="pl-kos">.</span><span class="pl-c1">MyProp</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">As during the next build it may work, this is certainly a compiler bug.</p>
<p dir="auto">Using Visual Studio 2015 -&gt; TypeScript for MS VS 1.6.3.0</p>