Skip to content

ComInterfaceGenerator should provide an info message when arrays don't have any [In] or [Out] attributes #90884

@jtschuster

Description

@jtschuster

The default for arrays is different than built in COM, and arrays are especially confusing. To help ensure people know what to expect from the generated code, we should nudge people to use [In] and [Out] attributes explicitly with an info message and code-fix to annotate the method to get the built-in COM behavior.

In particular, arrays of pinnable elements are [In] by default, but pin for performance reasons in managed to unmanaged. This means the managed to unmanaged behavior will still match built in com, but unmanaged to managed will not marshal out.

Since we now want to prefer explicit attributes, we also should remove the "Unnecessary [In] and [Out] attributes" info message.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions