Replace dead _complexity backing field with nullable auto-property (CS0414)#230
Open
wrigjl wants to merge 1 commit into
Open
Replace dead _complexity backing field with nullable auto-property (CS0414)#230wrigjl wants to merge 1 commit into
wrigjl wants to merge 1 commit into
Conversation
Ten reduction/verifier classes declared `private string _complexity = ""`
but never exposed it via a public property, producing CS0414 warnings and
silently omitting complexity from API responses. Replaced with:
public string? complexity { get; set; } = null;
Null is an explicit "not specified" sentinel, giving callers a consistent
JSON shape. Also adds the property to the Reduction and Solver scaffolding
templates so new classes get it by default.
Remaining: KarpGraphColorToExactCover.cs and ProblemVerifier.txt are
blocked on PRs ReduxISU#215 and ReduxISU#217 respectively.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6471b7f to
22a9473
Compare
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.
Summary
Ten reduction/verifier classes declared `private string _complexity = ""` but never wired up a public `complexity` property, causing two problems:
Replaced with a nullable auto-property decorated with `[JsonIgnore]` in all affected classes:
```csharp
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? complexity { get; set; } = null;
```
`null` is an explicit "not specified" sentinel. The `[JsonIgnore]` attribute means the field is omitted from the JSON response when null, keeping the API surface clean until a real value is provided. Also adds the property to the Reduction and Solver scaffolding templates so new classes get it by default.
Not included (blocked by other open PRs)
Test plan
🤖 Generated with Claude Code