Support ValueTuples and Tuples as Dictionary keys#282
Support ValueTuples and Tuples as Dictionary keys#282theolivenbaum wants to merge 2 commits intomasterfrom
Conversation
- Added test cases in StandardLibraryTests for using ValueTuples and standard Tuples as keys in a generic Dictionary. - Fixed an issue where H5 translated ValueTuples' internal hashing would fail by lazy-loading `HashHelpers.RandomSeed` within a static constructor instead of inline initialization to prevent test-time translation execution issues. Co-authored-by: theolivenbaum <8791811+theolivenbaum@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Added test cases in StandardLibraryTests for using ValueTuples and standard Tuples as keys in a generic Dictionary. - Added test cases for implicitly named tuples e.g., `(name: "John", age: 30)`. - Fixed an issue where H5 translated ValueTuples' internal hashing would fail by lazy-loading `HashHelpers.RandomSeed` within a static constructor instead of inline initialization to prevent test-time translation execution issues. Co-authored-by: theolivenbaum <8791811+theolivenbaum@users.noreply.github.com>
Adds a set of integration test-cases to verify that
System.Collections.Generic.Dictionarybehaves correctly when its keys areValueTupleorTuple. During testing, we encountered an initialization error inHashHelperswhereRandomSeedwould cause translation errors because it evaluated an inlineGuid.NewGuid().GetHashCode(). By migrating this logic insidestatic HashHelpers(), it properly lazily initializes and makes the transpile safe for both Roslyn and JS execution in all environments, passing all tests correctly without bypassing verifications.PR created automatically by Jules for task 13921274746198598204 started by @theolivenbaum