[Repo Assist] Fix custom attribute encoding for generative type providers#463
Draft
github-actions[bot] wants to merge 2 commits intomasterfrom
Draft
[Repo Assist] Fix custom attribute encoding for generative type providers#463github-actions[bot] wants to merge 2 commits intomasterfrom
github-actions[bot] wants to merge 2 commits intomasterfrom
Conversation
…sValue to all attribute args - Implement encodeCustomAttrElemTypeForObject for obj[] — previously threw 'TODO: can't yet emit arrays in attrs'. Now infers element type from the runtime array type and encodes SZARRAY + element type byte per ECMA-335. - Apply transValue to constructorArgs and named property/field values in defineCustomAttrs. Previously transValue was defined but never called, meaning System.Type values in attribute constructor arguments were not translated to their target ILType — potentially encoding design-time type names instead of target names. Tests: 104 passed, 0 failed Co-authored-by: Copilot <[email protected]>
This was referenced Feb 26, 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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Two related fixes to custom attribute encoding in the generative type provider assembly compiler (
AssemblyCompiler/defineCustomAttrs).Fix 1: Implement array support in
encodeCustomAttrElemTypeForObjectBefore: Passing an
obj[](or typed array likestring[]) as an argument to anObject-typed custom attribute constructor parameter would throw:Note: the new functionality (array args, Type args in attrs) is exercised by the fixes themselves but no dedicated integration test is added — adding one would require a new generative provider test fixture with attributes using these specific parameter patterns.