[Mono.Android.Export] Enable nullable reference types and remove MONOTOUCH guard in CodeWhen.cs#11695
Open
Copilot wants to merge 3 commits into
Open
[Mono.Android.Export] Enable nullable reference types and remove MONOTOUCH guard in CodeWhen.cs#11695Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Enable nullable reference types in CodeWhen.cs
[Mono.Android.Export] Enable nullable reference types in CodeWhen.cs
Jun 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Enables nullable reference types for CodeWhen.cs in Mono.Android.Export so the file participates in compile-time null-safety analysis without changing runtime behavior.
Changes:
- Added
#nullable enableinside the existing#if !MONOTOUCHguard at the top ofsrc/Mono.Android.Export/Mono.CodeGeneration/CodeWhen.cs.
| @@ -22,6 +22,8 @@ | |||
| // | |||
|
|
|||
| #if !MONOTOUCH | |||
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot
AI
changed the title
[Mono.Android.Export] Enable nullable reference types in CodeWhen.cs
[Mono.Android.Export] Enable nullable reference types and remove MONOTOUCH guard in CodeWhen.cs
Jun 18, 2026
jonathanpeppers
approved these changes
Jun 18, 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.
CodeWhen.csships inMono.Android.Export.dllbut was compiled in a nullable-oblivious context, getting no compile-time null-safety checks. The class is already null-correct, making it a low-risk opt-in candidate.Changes
#nullable enabletosrc/Mono.Android.Export/Mono.CodeGeneration/CodeWhen.cs.#if !MONOTOUCH/#endifwrapper around the file so the nullable context is applied unconditionally.Directive/preprocessor-only change — no logic modifications. All three reference-type fields (
condition,trueBlock,falseBlock) are unconditionally assigned in the single constructor, and methods dereference only non-null fields/parameters, so no nullable warnings are produced and no!null-forgiving operator was needed.