Tooltip for function overloaded to mimic variadic types infers wrong overload when called with trailing comma #23738
Labels
Bug
A bug in TypeScript
Domain: Quick Info
e.g. hover text, tool-tips, and tooltips.
Help Wanted
You can do this
Milestone
TypeScript Version: 2.7.0-dev.20180418
Search Terms: Intellisense overload, tooltip overload
Code
Expected behavior:
The inferred version of
test
(as shown in hover-over tooltip) fornoComma
,withComma
, and directly passed toassertTrue
is thetest<A>(a: A): true
version.Actual behavior:
The inferred version of
test
for thewithComma
and directly-passed versions is thetest<A, B>(a: A, b: B): false
, specificallytest<string, {}>(a: string, b: {}): false
.Despite this,
withComma
has typetrue
, and no error is reported for the call toassertTrue
with it or when directly passed.Playground Link: here
Related Issues: #7279
The text was updated successfully, but these errors were encountered: