Skip to content

Commit a4e7bff

Browse files
committed
Fixed errors with overloaded method exports
1 parent 49fd35d commit a4e7bff

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17893,7 +17893,8 @@ namespace ts {
1789317893
}
1789417894

1789517895
function isNotOverload(declaration: Declaration): boolean {
17896-
return declaration.kind !== SyntaxKind.FunctionDeclaration || !!(declaration as FunctionDeclaration).body;
17896+
return (declaration.kind !== SyntaxKind.FunctionDeclaration && declaration.kind !== SyntaxKind.MethodDeclaration) ||
17897+
!!(declaration as FunctionDeclaration).body;
1789717898
}
1789817899
}
1789917900

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
// @Filename: foo.d.ts
4+
//// declare class Foo {
5+
//// static prop1(x: number): number;
6+
//// static prop1(x: string): string;
7+
//// static prop2(x: boolean): boolean;
8+
//// }
9+
//// export = Foo; /*2*/
10+
11+
// @Filename: app.ts
12+
////import {/*1*/} from './foo';
13+
14+
goTo.marker('1');
15+
verify.completionListContains('prop1');
16+
verify.completionListContains('prop2');
17+
verify.not.completionListContains('Foo');
18+
verify.numberOfErrorsInCurrentFile(0);
19+
goTo.marker('2');
20+
verify.numberOfErrorsInCurrentFile(0);

0 commit comments

Comments
 (0)