Skip to content

[ctor] add regression test for setter in loop in NewOverSettersRule - #316

Merged
TomasVotruba merged 1 commit into
mainfrom
regression-test-setter-in-loop
Sep 24, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
regression-test-setter-in-loop

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Locks in behavior for a reported false-positive shape: a new at method level whose setter is called inside a foreach.

A setter called in a loop varies per iteration and cannot move to the constructor. The collector already ignores loop-nested setters, so such a site contributes no setter group and the rule does not fire. This adds a fixture across two methods, so it would fire if loop setters were ever counted - guarding the behavior against regressions.

@TomasVotruba
TomasVotruba merged commit 4dd9e08 into main Sep 24, 2026
8 checks passed
@TomasVotruba
TomasVotruba deleted the regression-test-setter-in-loop branch September 24, 2026 05:51
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.

1 participant