Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR bumps the package version and enhances nullable handling by refactoring how implicit conversion operators and nullability annotations are generated across core files, as well as cleaning up and reformatting related helper and extension code.
- Bumped project version to 1.3.2.
- Replaced non-nullable implicit conversions with nullable overloads decorated with
NotNullIfNotNull. - Moved and adjusted
[DisallowNull]placement and cleaned up deprecated/commented code.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Directory.Build.props | Updated <Version> from 1.3.1 to 1.3.2 |
| src/AltaSoft.Choice.Generator/Executor.cs | Refactored generation of implicit operators to nullable overloads and repositioned [DisallowNull] |
| src/AltaSoft.Choice.Generator/Helpers/SourceCodeBuilder.cs | Merged else and if into else if for header-line handling |
| src/AltaSoft.Choice.Generator/Extensions/RoslynExt.cs | Removed obsolete commented-out extension methods |
| src/AltaSoft.Choice.Generator/Extensions/CompilationExt.cs | Wrapped GetFullName in #pragma warning disable S1643/restore block |
| tests/AltaSoft.Choice.Generator.SnapshotTests/Snapshots/...Authorisation1Choice*.verified.cs | Regenerated snapshots to reflect nullable implicit operator changes |
| tests/AltaSoft.ChoiceGenerator.Tests/ChoiceGeneratorTests.cs | Added trailing newline |
Comments suppressed due to low confidence (3)
src/AltaSoft.Choice.Generator/Executor.cs:114
- The generator now only emits nullable implicit operators and removes the original non-nullable overload, which is a breaking change; consider retaining both a non-nullable operator (for backward compatibility) and the new nullable overload.
sb.AppendLine("[DisallowNull]");
tests/AltaSoft.ChoiceGenerator.Tests/ChoiceGeneratorTests.cs:301
- Add unit tests for the new nullable implicit operators, specifically scenarios where the input is null, to verify that the operator returns null as expected.
}
src/AltaSoft.Choice.Generator/Executor.cs:110
- [DisallowNull] is only applied in the else branch and omitted for DateOnly properties; you may want to add
[DisallowNull]afterXmlIgnoreto ensure consistent null-disallow behavior for all generated properties.
sb.AppendLine("[XmlIgnore]");
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.
No description provided.