<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.8.7</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="function func(val: &quot;Test&quot;) {
    console.log(val);
}

func(&quot;Test&quot;);"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">func</span><span class="pl-kos">(</span><span class="pl-s1">val</span>: <span class="pl-s">"Test"</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">val</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-en">func</span><span class="pl-kos">(</span><span class="pl-s">"Test"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong><br>
Should work normally and print "Test".</p>
<p dir="auto"><strong>Actual behavior:</strong><br>
A compile-time error is reported (highlighting <code class="notranslate">func</code>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="A signature with an implementation cannot use a string literal type."><pre class="notranslate"><code class="notranslate">A signature with an implementation cannot use a string literal type.
</code></pre></div>
<hr>
<p dir="auto">In my code I had a function that accepted an argument with a type including only two possible string literal values: say <code class="notranslate">"Value1"</code> and <code class="notranslate">"Value2"</code>, e.g <code class="notranslate">function func(val: "Value1" | "Value2")</code>, which worked OK. At some point I decided that "Value2" should not yet be supported so I removed it as an option. This left me with a unary string literal type, e.g. <code class="notranslate">function func(val: "Value1")</code>, but the compiler doesn't seem to like it?</p>
<p dir="auto">Specialized signatures needing to be compatible with an overload was an artificial requirement due to issues in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="46547257" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/943" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/943/hovercard" href="https://github.com/microsoft/TypeScript/issues/943">#943</a>. Now that we've fixed that, we should consider what we're going to do with this rule.</p>
<p dir="auto">Could we remove it wholesale? That would potentially be a breaking change, but it seems like good one. Basically, the situations you'd run into this would be where you have something like the following...</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function doThing(x: &quot;dog&quot;): Dog;
function doThing(x: &quot;cat&quot;): Cat;
function doThing(x: string): Animal;
function doThing(x: string, y?: string): Moose {
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-s1">doThing</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-s">"dog"</span><span class="pl-kos">)</span>: <span class="pl-smi">Dog</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-s1">doThing</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-s">"cat"</span><span class="pl-kos">)</span>: <span class="pl-smi">Cat</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-s1">doThing</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">Animal</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-en">doThing</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-s1">y</span>?: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">Moose</span> <span class="pl-kos">{</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Where now we'd check if the implementation was assignable to the specialized signatures and give an error. That seems like a good change.</p>