diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts
index 936bb15e94..1ff23f679d 100644
--- a/src/services/codefixes/importFixes.ts
+++ b/src/services/codefixes/importFixes.ts
@@ -798,6 +798,7 @@ namespace ts.codefix {
}
}
else if (isExportSpecifier(declaration)) {
+ Debug.assert(declaration.name.escapedText === InternalSymbolName.Default);
if (declaration.propertyName) {
return declaration.propertyName.escapedText;
}
diff --git a/tests/cases/fourslash/importNameCodeFixDefaultExport2.ts b/tests/cases/fourslash/importNameCodeFixDefaultExport2.ts
new file mode 100644
index 0000000000..8e09196d06
--- /dev/null
+++ b/tests/cases/fourslash/importNameCodeFixDefaultExport2.ts
@@ -0,0 +1,21 @@
+///
+
+// @allowJs: true
+// @checkJs: true
+
+// @Filename: /lib.js
+////class Base { }
+////export default Base;
+
+// @Filename: /test.js
+////[|class Derived extends Base { }|]
+
+goTo.file("/test.js");
+verify.importFixAtPosition([
+`// @ts-ignore
+class Derived extends Base { }`,
+`// @ts-nocheck
+class Derived extends Base { }`,
+`import Base from "./lib";
+
+class Derived extends Base { }`,]);
diff --git a/tests/cases/fourslash/importNameCodeFixDefaultExport3.ts b/tests/cases/fourslash/importNameCodeFixDefaultExport3.ts
new file mode 100644
index 0000000000..1d4c6bae8c
--- /dev/null
+++ b/tests/cases/fourslash/importNameCodeFixDefaultExport3.ts
@@ -0,0 +1,21 @@
+///
+
+// @allowJs: true
+// @checkJs: true
+
+// @Filename: /lib.js
+////class Base { }
+////export { Base as default };
+
+// @Filename: /test.js
+////[|class Derived extends Base { }|]
+
+goTo.file("/test.js");
+verify.importFixAtPosition([
+`// @ts-ignore
+class Derived extends Base { }`,
+`// @ts-nocheck
+class Derived extends Base { }`,
+`import Base from "./lib";
+
+class Derived extends Base { }`,]);