Number the occurrences of non-idempotent method calls - #91
Merged
Merged
Conversation
Identical method calls in a template share a single definition and a single value, which is wrong for a method whose repeated calls have to be evaluated separately. A template factory now takes the names of such methods. Every call of one gets an OccurrenceNumber, its 1-based number among the identical calls registered on the same value, and that number is a part of the call identity, so such calls no longer share a definition. Calls of any other method are untouched and their OccurrenceNumber stays null. A number belongs to a call site rather than to an evaluation: both arms of a condition get their own number and both have to be provided, a call in a loop body has a single number shared by all iterations, and two loops over one collection share a single definition for a call on the collection element. Model validation now reports a model that provides more than one value for a call the template requires, instead of failing on a duplicate dictionary key. Bumps the package version to 8.6.0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
| { | ||
| internal class AnalysisContext | ||
| { | ||
| private readonly HashSet<string> nonIdempotentMethodNames; |
Contributor
There was a problem hiding this comment.
А это правила либы, что без _ приваты?
Contributor
Author
There was a problem hiding this comment.
Да, везде без подчёркиваний
mnovikov-mindbox
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Identical method calls in a template share a single definition and a single value, which is wrong for a method whose repeated calls have to be evaluated separately.
A template factory now takes the names of such methods. Every call of one gets an OccurrenceNumber, its 1-based number among the identical calls registered on the same value, and that number is a part of the call identity, so such calls no longer share a definition. Calls of any other method are untouched and their OccurrenceNumber stays null.
A number belongs to a call site rather than to an evaluation: both arms of a condition get their own number and both have to be provided, a call in a loop body has a single number shared by all iterations, and two loops over one collection share a single definition for a call on the collection element.
Model validation now reports a model that provides more than one value for a call the template requires, instead of failing on a duplicate dictionary key.
Bumps the package version to 8.6.0.