Skip to content

Update 'code_writers' to pass marshaling info#2318

Merged
Sergio0694 merged 4 commits intouser/sergiopedri/optimize-agile-refs2from
user/sergiopedri/cswinrt-marshaling-type
Mar 8, 2026
Merged

Update 'code_writers' to pass marshaling info#2318
Sergio0694 merged 4 commits intouser/sergiopedri/optimize-agile-refs2from
user/sergiopedri/cswinrt-marshaling-type

Conversation

@Sergio0694
Copy link
Member

Follow up to #2255.

Sergio0694 and others added 4 commits March 7, 2026 22:44
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>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Sergio0694 Sergio0694 merged commit 6aef353 into user/sergiopedri/optimize-agile-refs2 Mar 8, 2026
15 checks passed
@Sergio0694 Sergio0694 deleted the user/sergiopedri/cswinrt-marshaling-type branch March 8, 2026 19:55
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants