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
This commit is contained in:
Nathan Shively-Sanders
2020-08-07 09:14:04 -07:00
parent dd09e8799c
commit 6e5d75b58b
2 changed files with 14 additions and 3 deletions
+1 -3
View File
@@ -35323,9 +35323,7 @@ namespace ts {
error(node, Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
}
if (isImportSpecifier(node) &&
(target.valueDeclaration && target.valueDeclaration.flags & NodeFlags.Deprecated
|| every(target.declarations, d => !!(d.flags & NodeFlags.Deprecated)))) {
if (isImportSpecifier(node) && isUncalledFunctionReference(target.valueDeclaration, target)) {
errorOrSuggestion(/* isError */ false, node.name, Diagnostics._0_is_deprecated, symbol.escapedName as string);
}
}
@@ -0,0 +1,13 @@
///<reference path="fourslash.ts" />
// @Filename: first.ts
//// /** @deprecated */
//// export declare function tap<T>(next: null): void;
//// export declare function tap<T>(next: T): T;
// @Filename: second.ts
//// import { tap } from './first';
//// tap
goTo.file('second.ts')
verify.noErrors()
verify.getSuggestionDiagnostics([]);