Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
BDisp
pushed a commit
to BDisp/Terminal.Gui
that referenced
this pull request
May 8, 2026
…ionary construction in DeepCloner (gui-cs#5243) * Initial plan * Fix AOT dictionary construction crash by using source-generated JSON serializer in DeepCloner Instead of Activator.CreateInstance (which fails when AOT trims default ctors), CreateDictionaryInstance now tries the source-generated JSON serializer context first. This fixes the category of AOT crashes for all dictionary types registered in SourceGenerationContext, not just individual instances. Removes the whack-a-mole CloneHardCodedPropertyValue from ConfigurationManager. Fixes gui-cs#5259 Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/9a0247ff-df16-449a-9b6e-4bebc68b2e41 Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix AOT JSON fallback: skip when comparer is needed, narrow exception catch The JSON serializer fallback in CreateDictionaryInstance created dictionaries with the default comparer, silently dropping any custom comparer passed by the caller. Now the JSON path is only used when no comparer is needed. Also narrowed the catch from bare Exception to InvalidOperationException to avoid masking unexpected failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Expand NativeAot example and add AOT publish to CI - Rewrite NativeAot example to use v2 API (Runnable<T>, Application.Create) and exercise AOT-sensitive view types: MenuBar, Menu, FrameView, CheckBox, OptionSelector, TextView, StatusBar, Dialog (via MessageBox), in addition to the existing Button, Label, TextField, Window. - Add 'dotnet publish' step to build-validation.yml. The previous 'dotnet build' did not trigger AOT compilation, so trimming/reflection errors were never caught in CI. Bump timeout to 15 min to accommodate. - Update README with current instructions and explanation of what the example exercises. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Refactor NativeAot sample as AOT-safe AllViewsTester Update NativeAot sample to explicitly construct and display all IDesignable Terminal.Gui views in a scrollable container, each within a titled FrameView. Integrate ViewPropertiesEditor for property editing, and include status and menu bars. Remove old login/options/notes demo. Revise documentation to explain the new approach, list tested views, and clarify AOT publishing/debugging. Update NativeAot.csproj to link editor files and add global usings. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tig <585482+tig@users.noreply.github.com> Co-authored-by: Tig <tig@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
BDisp
pushed a commit
to BDisp/Terminal.Gui
that referenced
this pull request
May 8, 2026
…-cs#5249) The fix from gui-cs#5243 ("Fixes gui-cs#5259. AOT: use source-generated JSON serializer for dictionary construction in DeepCloner") was reverted when release/v2.1.0-rc.1 merged origin/main back at 94dca98. That merge had conflicts in DeepCloner.cs and ConfigurationManager.cs and the resolution picked main's pre-gui-cs#5243 versions, dropping: - 27 lines from DeepCloner.cs (the SourceGenerationContext.GetTypeInfo fallback in CreateDictionaryInstance, plus its leading comment) and re-adding 54 lines to ConfigurationManager.cs: - CloneHardCodedPropertyValue and the per-type clone helpers (CloneKeyBindings, ClonePlatformKeyBinding, CloneKeyArray) that gui-cs#5243 had removed in favor of generic DeepCloner handling - the call site change from DeepClone to CloneHardCodedPropertyValue PRs gui-cs#5246 (rc.1 → main) and gui-cs#5247 (rc.1 backmerge → develop) carried the broken state forward. v2.1.0-beta.1 was tagged before the merge (no fix); v2.1.0-rc.1 was tagged after but doesn't have it either. Repro: `dotnet publish Examples/NativeAot -c Release -r win-x64 --self-contained -p:PublishAot=true` against current develop crashes at module init with `MissingMethodException: No parameterless constructor defined for type Dictionary<ColorName16, string>`. Same crash a downstream AOT consumer (clet) hit and tracked as gui-cs#5239 → gui-cs#5240 → gui-cs#5242 → gui-cs#5243 → gui-cs#5248. This commit checks DeepCloner.cs and ConfigurationManager.cs out of 11d6e27 (the original PR gui-cs#5243 merge), restoring the source-gen fallback and removing the per-type helpers. Verified locally: - `dotnet build Terminal.Gui/Terminal.Gui.csproj -c Release` → 0 errors - clet AOT publish + `clet.exe --version` runs cleanly (was crashing against rc.1; now exits 0 with the local TG nupkg pinned) Refs gui-cs#5239, gui-cs#5242, gui-cs#5243, gui-cs#5248, gui-cs#5259. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
🤖 Generated with Claude Code