Skip to content

Commit b1d6817

Browse files
author
Andy Hanson
committed
Use intersection of return types
1 parent c8f70c4 commit b1d6817

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17149,7 +17149,7 @@ namespace ts {
1714917149
/*typeParameters*/ undefined, // Before calling this we tested for `!candidates.some(c => !!c.typeParameters)`.
1715017150
thisParameter,
1715117151
parameters,
17152-
/*resolvedReturnType*/ unknownType,
17152+
/*resolvedReturnType*/ getIntersectionType(candidates.map(getReturnTypeOfSignature)),
1715317153
/*typePredicate*/ undefined,
1715417154
minArgumentCount,
1715517155
hasRestParameter,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
////interface A { a: number }
4+
////interface B { b: number }
5+
////declare function f(n: number): A;
6+
////declare function f(s: string): B;
7+
////f()./**/
8+
9+
verify.completionsAt("", ["a", "b"]);

0 commit comments

Comments
 (0)