-
Notifications
You must be signed in to change notification settings - Fork 15.7k
C#: add option and code generation for null reference types #16240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tonydnewell
wants to merge
5
commits into
protocolbuffers:main
Choose a base branch
from
tonydnewell:csharp-nrt-option
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
97a5cef
C#: add null ref types codegen
tonydnewell 9ab89ab
Merge branch 'protocolbuffers:main' into csharp-nrt-option
tonydnewell e405d4f
Merge branch 'protocolbuffers:main' into csharp-nrt-option
tonydnewell d6551b4
Update from review comments
tonydnewell 9485c6c
Merge branch 'protocolbuffers:main' into csharp-nrt-option
tonydnewell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,7 +105,16 @@ void ReflectionClassGenerator::WriteIntroduction(io::Printer* printer) { | |
"// <auto-generated>\n" | ||
"// Generated by the protocol buffer compiler. DO NOT EDIT!\n" | ||
"// source: $file_name$\n" | ||
"// </auto-generated>\n" | ||
"// </auto-generated>\n", | ||
"file_name", file_->name()); | ||
|
||
if (this->options()->enable_nullable_reference_types) { | ||
printer->Print( | ||
"#nullable enable annotations\n", | ||
tonydnewell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"file_name", file_->name()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need this line, as we're not using the |
||
} | ||
|
||
printer->Print( | ||
"#pragma warning disable 1591, 0612, 3021, 8981\n" | ||
"#region Designer generated code\n" | ||
"\n" | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: extra space at start (could fix after merging).