<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.8.2</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="type FooBar = &quot;foo&quot; | &quot;bar&quot;;

var map:{[foobBar:FooBar]: boolean};
"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">FooBar</span> <span class="pl-c1">=</span> <span class="pl-s">"foo"</span> <span class="pl-c1">|</span> <span class="pl-s">"bar"</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-s1">map</span>:<span class="pl-kos">{</span><span class="pl-kos">[</span><span class="pl-s1">foobBar</span>:<span class="pl-smi">FooBar</span><span class="pl-kos">]</span>: <span class="pl-smi">boolean</span><span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong></p>
<p dir="auto">I should be able to define a index type with a string literal type as key.</p>
<p dir="auto"><strong>Actual behavior:</strong></p>
<p dir="auto">The typescript compiler complains with</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Error:(3, 11) TS1023: An index signature parameter type must be 'string' or 'number'."><pre class="notranslate"><code class="notranslate">Error:(3, 11) TS1023: An index signature parameter type must be 'string' or 'number'.
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export interface Keyed&lt;k extends string, a&gt; {
    [key: k]: a; // &lt;-- An index signature parameter type must be 'string' or 'number'.
}"><pre class="notranslate"><code class="notranslate">export interface Keyed&lt;k extends string, a&gt; {
    [key: k]: a; // &lt;-- An index signature parameter type must be 'string' or 'number'.
}
</code></pre></div>