Skip to content

Conversation

@weswigham
Copy link
Member

Fixes #58490 - an error is now always emitted on computed names in classes and object literals under --isolatedDeclarations. Workarounds and carve-outs for builtin symbols, some new syntactic form, or locally bound unique symbols are followups~

cc @dragomirtitian

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels May 20, 2024
@weswigham weswigham requested a review from jakebailey May 21, 2024 22:33
else if (prop.name.kind === SyntaxKind.ComputedPropertyName) {
const expression = prop.name.expression;
if (!isPrimitiveLiteralValue(expression, /*includeBigInt*/ false) && !isEntityNameExpression(expression)) {
if (!isPrimitiveLiteralValue(expression, /*includeBigInt*/ false)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also code in typeFromObjectLiteral that is not effectively unused. isNonNarrowedBindableName also probably becomes useless since we can now syntactically determine if the computed property is valid so it can probably be removed from the resolver.

@dragomirtitian
Copy link
Contributor

@weswigham Also fixes #58533

@weswigham weswigham merged commit b682ed4 into microsoft:main May 22, 2024
@weswigham weswigham deleted the isolated-computed-names branch May 22, 2024 19:28
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[isolatedDeclarations][5.5] Disagreement between transpileDeclaration API and typechecker on Symbol.iterator as computed property

4 participants