Skip to content

unique symbol type imported in declaration files used as computed property key can not be named #38516

Description

@mohsen1

TypeScript Version: 3.8 and 3.9.2

This is a regression from 3.7.

Search Terms:
unique symbol, index signature

Code
This is a distilled code from a bigger codebase. The Op is imported from Sequelize

importOpfrom'./op';exportdefaultfunctionfoo(){return{[Op.or]: [],};}
// op.tsdeclareconstOp: {readonlyor: unique symbol;};exportdefaultOp;

tsconfig.json

{
"compilerOptions": {
"outDir": "dist",
"target": "es5",
"module": "commonjs",
"declaration": true,
"strict": true,
"esModuleInterop": true
}
}

Expected behavior:
No Error
Actual behavior:

index.ts:3:25 - error TS4058: Return type of exported function has or is using name 'or' from external module "/Users/mohsen_azimi/Desktop/3.9-regression/op" but cannot be named.
3 export default function foo() {
~~~

Related Issues:
#9944

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions