Skip to content

Warning for struct copy of selected types #26937

@gafter

Description

@gafter

See item 1 from dotnet/csharplang#1502.

Please add a way to get warnings for situations in which the compiler would or does produce a defensive copy for a struct type that has some particular new attribute on it. This should be under control of a warning wave (i.e. the warning is off by default so as to reduce compatibility issues*).

*the compatibility concern is that code that uses the attribute and for which there is a defensive copy produces no diagnostic in an older version of the compiler, but does produce a diagnostic in a new version of the compiler.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions