Skip to content

Conversation

@Andarist
Copy link
Contributor

@Andarist Andarist commented Jun 4, 2025

Copilot AI review requested due to automatic review settings June 4, 2025 12:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Ports the TypeScript fix to allow assignments to readonly class properties within IIFEs inside constructors.

  • Updates test baselines to reflect correct property types and error counts for nested IIFE assignments.
  • Removes outdated .diff baselines and adjusts the main baselines accordingly.
  • Changes the checker to use getControlFlowContainer for identifying constructor scope in nested functions.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
testdata/baselines/reference/submodule/compiler/readonlyMembers.types.diff Removed outdated baseline diff file
testdata/baselines/reference/submodule/compiler/readonlyMembers.types Updated expected types for readonly property assignments in IIFEs
testdata/baselines/reference/submodule/compiler/readonlyMembers.errors.txt.diff Removed outdated error baseline diff file
testdata/baselines/reference/submodule/compiler/readonlyMembers.errors.txt Updated expected error count and entries for nested IIFE assignments
internal/checker/checker.go Replaced getContainingFunction with c.getControlFlowContainer to detect constructors across IIFEs
Comments suppressed due to low confidence (1)

internal/checker/checker.go:25870

  • [nitpick] Add a brief comment explaining that getControlFlowContainer is used instead of getContainingFunction to correctly identify constructor scopes even when assignments occur inside nested IIFEs.
ctor := c.getControlFlowContainer(expr)

@jakebailey jakebailey added this pull request to the merge queue Jun 4, 2025
Merged via the queue into microsoft:main with commit 073c466 Jun 4, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants