<p dir="auto">Test Case:</p>
<p dir="auto">interface Overload {</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="foo(id:&quot;special&quot;, value:number):void;
foo(id:string, value:any):void;"><pre class="notranslate"><code class="notranslate">foo(id:"special", value:number):void;
foo(id:string, value:any):void;
</code></pre></div>
<p dir="auto">}</p>
<p dir="auto">class Bug {</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="private overload:Overload;

public call():void {
    this.overload.foo(&quot;special&quot;, &quot;&quot;);
}"><pre class="notranslate"><code class="notranslate">private overload:Overload;

public call():void {
    this.overload.foo("special", "");
}
</code></pre></div>
<p dir="auto">}</p>
<p dir="auto">Compile with tsc. Observe that there is no error message. Shouldn't the compiler complain about the fact that this.overload.foo("special", "") is an incompatible call. E.g. "" is not assignment compatible to number.</p>
<p dir="auto">Hi, consider this bit of code:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Bar {
    public bar: string;
}
interface IFoo {
    doFoo(type: any, bar: any): void;
    doFoo(type: &quot;Quux&quot;, bar: Bar): string;
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-smi">Bar</span> <span class="pl-kos">{</span>
    <span class="pl-k">public</span> <span class="pl-c1">bar</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">interface</span> <span class="pl-smi">IFoo</span> <span class="pl-kos">{</span>
    <span class="pl-c1">doFoo</span><span class="pl-kos">(</span><span class="pl-s1">type</span>: <span class="pl-smi">any</span><span class="pl-kos">,</span> <span class="pl-s1">bar</span>: <span class="pl-smi">any</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-c1">doFoo</span><span class="pl-kos">(</span><span class="pl-s1">type</span>: <span class="pl-s">"Quux"</span><span class="pl-kos">,</span> <span class="pl-s1">bar</span>: <span class="pl-smi">Bar</span><span class="pl-kos">)</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">We use it like this:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var foo: IFoo;
var result:string = foo.doFoo(&quot;Quux&quot;, new Bar()); // fine"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">foo</span>: <span class="pl-smi">IFoo</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">result</span>:<span class="pl-smi">string</span> <span class="pl-c1">=</span> <span class="pl-s1">foo</span><span class="pl-kos">.</span><span class="pl-en">doFoo</span><span class="pl-kos">(</span><span class="pl-s">"Quux"</span><span class="pl-kos">,</span> <span class="pl-k">new</span> <span class="pl-smi">Bar</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// fine</span></pre></div>
<p dir="auto">However, while still specifying "Quux", if we pass any type other than new Bar() for the second argument, the compiler falls back to the non-overloaded method:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Error TS2011: Cannot convert 'void' to 'string'.
var result2: string = foo.doFoo(&quot;Quux&quot;, &quot;bar&quot;);"><pre class="notranslate"><span class="pl-c">// Error TS2011: Cannot convert 'void' to 'string'.</span>
<span class="pl-k">var</span> <span class="pl-s1">result2</span>: <span class="pl-smi">string</span> <span class="pl-c1">=</span> <span class="pl-s1">foo</span><span class="pl-kos">.</span><span class="pl-en">doFoo</span><span class="pl-kos">(</span><span class="pl-s">"Quux"</span><span class="pl-kos">,</span> <span class="pl-s">"bar"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">I think this is a bit unfortunate. We are missing an opportunity to verify that the additional arguments also match the overloaded signature.</p>
<p dir="auto">Ideally the following</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="foo.doFoo(&quot;Quux&quot;, &quot;bar&quot;);"><pre class="notranslate"><span class="pl-s1">foo</span><span class="pl-kos">.</span><span class="pl-en">doFoo</span><span class="pl-kos">(</span><span class="pl-s">"Quux"</span><span class="pl-kos">,</span> <span class="pl-s">"bar"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">should generate error TS2082: Supplied parameters do not match any signature of call target</p>
<p dir="auto">See further discussion on the old <a href="https://typescript.codeplex.com/workitem/993" rel="nofollow">codeplex site</a>.</p>