Repository navigation
GH4977: Fix CS8632 for aliases from nullable enabled addins - #4986
Merged
Merged
Conversation
* Propagate HandleExitCode, NoWorkingDirectory, PostAction and SetupProcessSettings to DotNetExecuteSettings * Add CakeRunnerCoreFixture driving the Cake.dll execution path through the .NET host * Add CakeRunner tests covering the host path, arguments and the propagated settings * fixes cake-build#4985
devlead
force-pushed
the
feature/gh-4977
branch
from
September 12, 2026 19:30
75d60f0 to
36468cc
Compare
* Wrap only nullable aware generated aliases in #nullable enable/restore, instead of suppressing CS8632 globally * Emit ? from NullableAttribute flag 2, including inner generic arguments and array elements * Leave unconstrained type parameters unannotated, as NullabilityInfoContext can't tell T from T? apart * Emit class?, notnull and notnull combined with new() generic parameter constraints * Add unit, code generation and integration test coverage for nullable aware aliases * fixes cake-build#4977
devlead
force-pushed
the
feature/gh-4977
branch
from
September 12, 2026 19:40
36468cc to
8beeef6
Compare
This was referenced Sep 14, 2026
This was referenced Sep 15, 2026
This was referenced Sep 24, 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.
Cake.Tool emits CS8632 for addins compiled with nullable reference types enabled, and
#nullable disablein the.cakefile doesn't help, because aliases are generated above the userscript in a compilation where annotations are disabled.
Nullable aware alias generation (#4977)
#nullable enable/#nullable restore. CS8632 is not suppressed anywhere, and scripts keep the oblivious contextthey have today.
?is emitted fromNullableAttribute/NullableContextAttributeflag2, including innergeneric arguments and array elements, so
IList<string?>,string?[]?andTask<string?>allround trip.
NullabilityInfoContextreports every usage ofsuch a parameter as nullable, so it can't tell
TfromT?; for those positions the nullableflag of the parameter or return position decides instead.
class?is emitted asclass?, andnotnullis emitted whenever no other constraint implies it, including alongsidenew().Dropped CakeSettings on the Cake.dll path (#4985)
CakeRunner.ExecuteScripthand-copies settings ontoDotNetExecuteSettingswhen the resolved toolpath is
Cake.dll, which is the default whenever the outer build runs on Cake.Tool.HandleExitCode,NoWorkingDirectory,PostActionandSetupProcessSettingswere missing fromthat copy and silently dropped. They're now propagated, which is also what lets the new integration
test capture the nested script's compiler output.