diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1a06d1a1471a5..795ed08683d42 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -28472,6 +28472,7 @@ namespace ts { if (hasSyntheticDefault) { const memberTable = createSymbolTable(); const newSymbol = createSymbol(SymbolFlags.Alias, InternalSymbolName.Default); + newSymbol.parent = originalSymbol; newSymbol.nameType = getLiteralType("default"); newSymbol.target = resolveSymbol(symbol); memberTable.set(InternalSymbolName.Default, newSymbol); diff --git a/tests/cases/fourslash/exportEqualNamespaceClassESModuleInterop.ts b/tests/cases/fourslash/exportEqualNamespaceClassESModuleInterop.ts new file mode 100644 index 0000000000000..dfb180e6fbcb2 --- /dev/null +++ b/tests/cases/fourslash/exportEqualNamespaceClassESModuleInterop.ts @@ -0,0 +1,28 @@ +/// + +// @esModuleInterop: true +// @moduleResolution: node +// @target: es2015 +// @module: esnext + +// @Filename: /node_modules/@bar/foo/index.d.ts +//// export = Foo; +//// declare class Foo {} +//// declare namespace Foo {} // class/namespace declaration causes the issue + +// @Filename: /node_modules/foo/index.d.ts +//// import * as Foo from "@bar/foo"; +//// export = Foo; + +// @Filename: /index.ts +//// import Foo from "foo"; +//// /**/ + +goTo.file("/index.ts"); +verify.completions({ + marker: "", + includes: ["Foo"], + preferences: { + includeCompletionsForModuleExports: true + } +}); \ No newline at end of file