mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Component commits:6e5d75b58bUse isUncalledFunctionReference for aliases too Fixes bogus deprecated notices on imports of functions with deprecated overloads, but with some non-deprecated overloads. Fixes microsoft/vscode#104238e2eb319e72Just check all declarations, don't call isUncalledFunction Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>
This commit is contained in:
co-authored by
Nathan Shively-Sanders
parent
264d27e779
commit
3055018556
@@ -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) && every(target.declarations, d => !!(getCombinedNodeFlags(d) & NodeFlags.Deprecated))) {
|
||||
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([]);
|
||||
@@ -0,0 +1,11 @@
|
||||
///<reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: first.ts
|
||||
//// export class logger { }
|
||||
// @Filename: second.ts
|
||||
//// import { logger } from './first';
|
||||
//// new logger()
|
||||
|
||||
goTo.file('second.ts')
|
||||
verify.noErrors()
|
||||
verify.getSuggestionDiagnostics([]);
|
||||
Reference in New Issue
Block a user