Update 'code_writers' to pass marshaling info#2318
Merged
Sergio0694 merged 4 commits intouser/sergiopedri/optimize-agile-refs2from Mar 8, 2026
Merged
Conversation
Add get_marshaling_type_name() that reads the MarshalingBehaviorAttribute from a TypeDef and returns the corresponding C# CreateObjectReferenceMarshalingType enum value string for code generation. Maps MarshalingType.Agile (2) and MarshalingType.Standard (3) to their respective enum members, defaulting to Unknown for all other cases. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pass CreateObjectReferenceMarshalingType to base constructor calls in write_factory_constructors for both parameterized (callback-based) and parameterless (DerivedSealed) factory activation patterns. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pass CreateObjectReferenceMarshalingType to base constructor calls in write_composable_constructors for both parameterless (DerivedComposed) and parametered (callback-based) patterns. Also update all four protected pass-through constructors to accept and forward the marshalingType parameter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pass CreateObjectReferenceMarshalingType to CreateObjectReference and CreateObjectReferenceUnsafe calls in write_class_comwrappers_marshaller_attribute and write_class_comwrappers_callback (sealed and unsealed paths, 4 call sites). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6aef353
into
user/sergiopedri/optimize-agile-refs2
15 checks passed
Sergio0694
added a commit
that referenced
this pull request
Mar 8, 2026
* Add helper to read MarshalingBehaviorAttribute from .winmd metadata Add get_marshaling_type_name() that reads the MarshalingBehaviorAttribute from a TypeDef and returns the corresponding C# CreateObjectReferenceMarshalingType enum value string for code generation. Maps MarshalingType.Agile (2) and MarshalingType.Standard (3) to their respective enum members, defaulting to Unknown for all other cases. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update factory constructor generation with marshalingType parameter Pass CreateObjectReferenceMarshalingType to base constructor calls in write_factory_constructors for both parameterized (callback-based) and parameterless (DerivedSealed) factory activation patterns. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update composable constructor generation with marshalingType parameter Pass CreateObjectReferenceMarshalingType to base constructor calls in write_composable_constructors for both parameterless (DerivedComposed) and parametered (callback-based) patterns. Also update all four protected pass-through constructors to accept and forward the marshalingType parameter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update ComWrappers marshaller/callback with marshalingType parameter Pass CreateObjectReferenceMarshalingType to CreateObjectReference and CreateObjectReferenceUnsafe calls in write_class_comwrappers_marshaller_attribute and write_class_comwrappers_callback (sealed and unsealed paths, 4 call sites). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
Follow up to #2255.