Skip to content

Bug: can't pass struct arrays to WinRT methods #2287

@FrayxRulez

Description

@FrayxRulez

Description

Passing a struct array (ie Color[]) to a WinRT exported method causes an exception to be thrown within CsWinRT:

Cannot provide IReferenceArray`1 support for element type 'Windows.UI.Color'.

This happens for any struct not explicitly referenced in ProvideIReferenceArray

Steps To Reproduce

  1. Export a WinRT method that accepts IVector<Windows.UI.Color>
  2. Pass a List to it, notice that everything works fine
  3. Pass a Color[] to it, notice that the call will fail

Expected Behavior

Passing around struct arrays causes no issues

Version Info

Happens with both stable and 2.3.0 prerelease

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions