<p dir="auto">Hi,</p>
<p dir="auto"><strong>Version:</strong> TS 1.6</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="module foo.bar {
    export function baz(){}
};

module foo {
  const a1 = bar['baz']; // foo.bar['baz']
  const a2 = (&lt;any&gt;bar)['baz']; // foo.bar['baz']
  const a3 = (bar as any)['baz'];  // bar['baz']
}"><pre class="notranslate"><code class="notranslate">module foo.bar {
    export function baz(){}
};

module foo {
  const a1 = bar['baz']; // foo.bar['baz']
  const a2 = (&lt;any&gt;bar)['baz']; // foo.bar['baz']
  const a3 = (bar as any)['baz'];  // bar['baz']
}
</code></pre></div>
<p dir="auto">The emit for <code class="notranslate">a3</code> appears to be wrong.</p>
<p dir="auto"><strong>foo.ts</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export function foo() { }"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">function</span> <span class="pl-en">foo</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"><strong>bar.ts</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { foo } from './foo';

(foo as any);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">foo</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'./foo'</span><span class="pl-kos">;</span>

<span class="pl-kos">(</span><span class="pl-s1">foo</span> <span class="pl-k">as</span> <span class="pl-smi">any</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>bar.js</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var foo_1 = require('./foo');
foo;"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">foo_1</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'./foo'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">foo</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><code class="notranslate">(&lt;any&gt;foo)</code> works correctly btw.</p>