Repository navigation
land kanban 586 - #406
Merged
StevenTCramer merged 7 commits intoNov 14, 2026
Merged
land kanban 586#406StevenTCramer merged 7 commits into
StevenTCramer merged 7 commits into
Conversation
Land-Holder: cramer
…emits-null-checks-on-user-value-type
A handler returning a user enum or struct got an 'is not null' guard (CS0037) and a '?.ToString()' JSON fallback (CS0023), because the invoker emitter knew only BCL value types by name. Extractors now carry ResultValueKind on HandlerReturnType and the problem-pair success type; the emitter skips the null guard and '?.' for non-nullable value types and prints enums raw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
M1 is wontfix. The review diffed against master, but task 583 stacks on feature/generator-fixes-2026-11-14 (work-set 586,583,584,585), which already carries task 586 via PR #405. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StevenTCramer
merged commit Nov 14, 2026
a52e46d
into
feature/generator-fixes-2026-11-14
7 checks passed
StevenTCramer
deleted the
task/583-generator-emits-null-checks-on-user-value-type
branch
November 14, 2026 05:54
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
What changed
ResultValueKind(MaybeNull,ValueType,Enum) insource/timewarp-nuru-analyzers/generators/models/result-value-kind.cs, read from theITypeSymbolbyResultValueKinds.Of(Nullable<T>staysMaybeNull).HandlerReturnType.ValueKind(the result, orTofTask<T>) andHandlerDefinition.SuccessValueKind(problempair success type), set by every extractor that builds a return type: lambda expression and block bodies, method
groups,
[NuruRoute]command classes (IQuery<T>/ICommand<T>), and[Operation]mediator endpoints.HandlerDefinition.RenderedValueKindpicks the one the invoker writes.HandlerInvokerEmitter.EmitResultOutputskipsis not nullfor any non-nullable value type, and the JSONfallback writes
result.ToString()with no?.for one.GetOutputStrategysends a non-nullable enum toRaw, so an enum result prints its member name (Dark) instead of JSON; capabilities now reports such a route'sreturnTypekind asPrimitive. User structs keep the JSON strategy.for a CLI than the member name, and matches how the binder takes enum input by name.
shade.ToString()is gone)and adds an async enum delegate and an enum method group; new
tests/timewarp-nuru-tests/routing/routing-39-value-type-results.cspins runtime output (delegate, async delegate, method group,
IQuery<TEnum>endpoint, user struct,Nullable<TEnum>null writes nothing) in the CI multi-mode assembly.ganda repo audit --fixset the VS Code window title/icon in the git-ignored.vscode/settings.json(advisoryvscode-window-iconwarning); nothing to commit.Follow-up (not fixed here)
fails with CS0246:
GetReturnTypeName/GetUnwrappedReturnTypeNameandEmitRenderdeclare the result local byShortTypeName(minimally qualified). It hits reference types too, so it is its own defect; routing-39 keeps itsresult types in the global namespace for that reason. Worth a separate task (fully qualified names need the
nullable reference
?kept, orvar).Gates
./bin/dev buildganda runfile cache --clearthen./bin/dev testganda repo auditvscode-window-iconwarning, fixed with--fix, rerun "Repository passes all audit checks."; fix pass 1 rerun: pass (exit 0, "Repository passes all audit checks.")Test plan
Smoke:
Expect: routing-39 6/6 pass (
vtr-mode DarkprintsDark, theIQuery<VtrShade>endpoint printsLight,the struct writes both members, the null
VtrShade?writes nothing); generator-75 6/6 pass, with.WithHandler((Gen75Shade shade) => shade)compiling as a consumer. Inartifacts/generated/routing-39-value-type-results.cs/.../NuruGenerated.g.csthe enum route emitsapp.Terminal.WriteLine(result.ToString());with noif (result is not null), and the struct's JSON fallback isresult.ToString()with no?..Kanban task 583
Session: 1411579