We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Since 4.8.0, TypeScript errors when defining a constructor accessor on plain objects. Likely as a side-effect of #48954
constructor
constructor accessor object
Playground Link: Provided
"use strict"; const foo = { get constructor() { return {}; } };
{ "compilerOptions": { "strict": true, "noImplicitAny": true, "strictNullChecks": true, "strictFunctionTypes": true, "strictPropertyInitialization": true, "strictBindCallApply": true, "noImplicitThis": true, "noImplicitReturns": true, "alwaysStrict": true, "esModuleInterop": true, "declaration": true, "experimentalDecorators": true, "emitDecoratorMetadata": true, "target": "ES2017", "jsx": "react", "module": "ESNext", "moduleResolution": "node" } }
const foo = { get constructor() { return {}; } };
Class constructor may not be an accessor. ts(1341)
No error for non class cases.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Bug Report
Since 4.8.0, TypeScript errors when defining a
constructor
accessor on plain objects. Likely as a side-effect of #48954🔎 Search Terms
constructor accessor object
🕗 Version & Regression Information
⏯ Playground Link
Playground Link: Provided
Output
Compiler Options
💻 Code
🙁 Actual behavior
Class constructor may not be an accessor. ts(1341)
🙂 Expected behavior
No error for non class cases.
The text was updated successfully, but these errors were encountered: