mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
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:
@@ -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([]);
|
||||
Reference in New Issue
Block a user