refactor: accept IDictionary for sysInputs - #3
Closed
msallin wants to merge 1 commit into
Closed
Conversation
Dictionary<string, string> forced callers to materialise a concrete dictionary; a ReadOnlyDictionary or ImmutableDictionary could not be passed. Widening the parameters to IDictionary<string, string> keeps every existing call site compiling.
msallin
force-pushed
the
claude/typstcompiler-idictionary-param-d9322f
branch
from
September 6, 2026 17:44
4b6ed4f to
5635342
Compare
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.
sysInputson theTypstCompilerconstructor,FromSource,FromFile, the staticCompilePdf/CompileSvg/CompilePnghelpers, and the argument ofSetSysInputswere typed asDictionary<string, string>. That forced callers holding aReadOnlyDictionary<string, string>,ImmutableDictionary<string, string>or a custom implementation to copy into a concreteDictionaryfirst.They now take
IDictionary<string, string>. Widening a parameter type is source compatible, so every existing call passing aDictionary<string, string>keeps compiling.The JSON source generation context registers
IDictionary<string, string>instead ofDictionary<string, string>; the generator emitsCreateIDictionaryInfometadata for it, so serialization stays source generated and trim/AOT friendly.Added two tests that pass a
ReadOnlyDictionary<string, string>through both the constructor parameter andSetSysInputs, and assert the value reachessys.inputsin the rendered document.Full suite: 47 passed, 0 failed.