Repository navigation
fix(mutation): improve mutation of interpolated strings - #4046
Merged
Merged
Conversation
dupdob
force-pushed
the
keep_interpolated_string_type
branch
from
November 25, 2026 22:07
bf730f6 to
cf7d2f2
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical guard gaps allow invalid conditional injection in void-returning lambdas, other void-bodied contexts, and for-loop initializer/incrementor lists, producing mutants that cannot compile.
2 open issues
What changed in this PR
This PR improves Stryker.NET’s interpolated-string mutation placement to preserve conversions to interpolated-string handlers and FormattableString.
Changes:
- Adds and registers an orchestrator that defers mutations requiring interpolated-string conversions.
- Prevents conditional injection in expression statements and void method arrow bodies.
- Adds regression tests and enables an existing top-level statement test.
| File | Description |
|---|---|
src/Stryker.Core/Stryker.Core/Mutators/InterpolatedStringMutator.cs |
Makes the empty-string factory static with a specific syntax return type. |
src/Stryker.Core/Stryker.Core/Mutants/MutationStore.cs |
Adds guards for contexts that cannot use conditional expressions. |
src/Stryker.Core/Stryker.Core/Mutants/CsharpNodeOrchestrators/InvocationExpressionOrchestrator.cs |
Adjusts whitespace only. |
src/Stryker.Core/Stryker.Core/Mutants/CsharpNodeOrchestrators/InterpolatedStringOrchestrator.cs |
Defers mutation placement for special interpolated-string conversions. |
src/Stryker.Core/Stryker.Core/Mutants/CsharpMutantOrchestrator.cs |
Registers the interpolated-string orchestrator. |
src/Stryker.Core/Stryker.Core.UnitTest/Mutants/CsharpMutantOrchestratorTests.cs |
Adds conversion and placement tests; enables an existing test. |
Review effort: Balanced
dupdob
force-pushed
the
keep_interpolated_string_type
branch
2 times, most recently
from
November 25, 2026 22:49
0dd08e1 to
bf01a5c
Compare
dupdob
force-pushed
the
keep_interpolated_string_type
branch
from
November 26, 2026 06:16
bf01a5c to
2e2eeb8
Compare
|
This was referenced Nov 29, 2026
This was referenced Dec 3, 2026
Merged
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.




ensure interpolated string type is kept during mutation