Skip to content

Commit 6e5d75b

Browse files
committed
Use isUncalledFunctionReference for aliases too
Fixes bogus deprecated notices on imports of functions with deprecated overloads, but with some non-deprecated overloads. Fixes microsoft/vscode#104238
1 parent dd09e87 commit 6e5d75b

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35323,9 +35323,7 @@ namespace ts {
3532335323
error(node, Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
3532435324
}
3532535325

35326-
if (isImportSpecifier(node) &&
35327-
(target.valueDeclaration && target.valueDeclaration.flags & NodeFlags.Deprecated
35328-
|| every(target.declarations, d => !!(d.flags & NodeFlags.Deprecated)))) {
35326+
if (isImportSpecifier(node) && isUncalledFunctionReference(target.valueDeclaration, target)) {
3532935327
errorOrSuggestion(/* isError */ false, node.name, Diagnostics._0_is_deprecated, symbol.escapedName as string);
3533035328
}
3533135329
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
///<reference path="fourslash.ts" />
2+
3+
// @Filename: first.ts
4+
//// /** @deprecated */
5+
//// export declare function tap<T>(next: null): void;
6+
//// export declare function tap<T>(next: T): T;
7+
// @Filename: second.ts
8+
//// import { tap } from './first';
9+
//// tap
10+
11+
goTo.file('second.ts')
12+
verify.noErrors()
13+
verify.getSuggestionDiagnostics([]);

0 commit comments

Comments
 (0)