diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f9c6a04324a..748cab985da 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -35323,7 +35323,7 @@ namespace ts { error(node, Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type); } - if (isImportSpecifier(node) && isUncalledFunctionReference(target.valueDeclaration, target)) { + if (isImportSpecifier(node) && every(target.declarations, d => !!(getCombinedNodeFlags(d) & NodeFlags.Deprecated))) { errorOrSuggestion(/* isError */ false, node.name, Diagnostics._0_is_deprecated, symbol.escapedName as string); } } diff --git a/tests/cases/fourslash/jsdocDeprecated_suggestion9.ts b/tests/cases/fourslash/jsdocDeprecated_suggestion9.ts new file mode 100644 index 00000000000..bf5ef1b12da --- /dev/null +++ b/tests/cases/fourslash/jsdocDeprecated_suggestion9.ts @@ -0,0 +1,11 @@ +/// + +// @Filename: first.ts +//// export class logger { } +// @Filename: second.ts +//// import { logger } from './first'; +//// new logger() + +goTo.file('second.ts') +verify.noErrors() +verify.getSuggestionDiagnostics([]);