Skip to content

test: add regression coverage for await in computed member names of namespace classes (#63712) - #64255

Closed
Vaibhav Srivastava (vaibhavsrv) wants to merge 1 commit into
microsoft:mainfrom
vaibhavsrv:test/namespace-await-computed-name-coverage
Closed

test: add regression coverage for await in computed member names of namespace classes (#63712)#64255
Vaibhav Srivastava (vaibhavsrv) wants to merge 1 commit into
microsoft:mainfrom
vaibhavsrv:test/namespace-await-computed-name-coverage

Conversation

@vaibhavsrv

Copy link
Copy Markdown

Resolves #63712

Summary of Changes

Adds a regression test case to verify that diagnostic TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules is reported consistently for both exported and unexported classes within namespace declarations.

Test Coverage

  • Added tsc/testdata/tests/cases/conformance/async/namespaceAwaitComputedName.ts
  • Verifies TS1308 emission for class A { [await x]() {} } and export class B { [await x]() {} } within a namespace scope.

Copilot AI balanced review requested due to automatic review settings September 13, 2026 07:02
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Sep 13, 2026
@typescript-automation typescript-automation Bot added the For Backlog Bug PRs that fix a backlog bug label Sep 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Add the required baselines and resolve the duplicate test coverage.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds conformance regression coverage for TS1308 when await appears in computed member names of namespace classes.

Changes:

  • Tests exported and unexported namespace classes.
  • Targets consistent diagnostic reporting.
File summaries
File Summary
tsc/testdata/tests/cases/conformance/async/namespaceAwaitComputedName.ts Adds the regression cases; required reference baselines are missing, and the cases duplicate existing coverage.
Review details

Suppressed comments (1)

tsc/testdata/tests/cases/conformance/async/namespaceAwaitComputedName.ts:8

  • These exact unexported and exported namespace-class cases are already covered by tsc/testdata/tests/cases/compiler/awaitInNamespaceExportedClassComputedProperty.ts (including TS1308 entries in its checked-in .errors.txt baseline). Adding the same inputs here provides no new coverage; please extend the existing regression test or remove this duplicate unless this suite is intended to exercise a distinct configuration.
namespace N {
  class A { [await x]() {} }
  export class B { [await x]() {} }
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.

Comment on lines +7 to +8
class A { [await x]() {} }
export class B { [await x]() {} }
@vaibhavsrv

Copy link
Copy Markdown
Author

Closing PR as issue #63712 already has existing test coverage in awaitInNamespaceExportedClassComputedProperty.ts.

@github-project-automation github-project-automation Bot moved this from Not started to Done in PR Backlog Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Exported namespace class suppresses TS1308 for await in computed member names

2 participants