Skip to content

Should some synthesized methods be marked as readonly? #36587

@RikkiGibson

Description

@RikkiGibson

Migrated from #32911 (discussion)

@jcouv: something to consider for a follow-up: I see that we're only adding the IsReadOnlyAttribute for source method symbols. I wonder if there are other method symbols we should consider (some synthesized ones in particular).

@RikkiGibson: Not certain. There's a few requirements for this to provide a benefit:

  1. must be an instance method on a struct type
  2. must be called on a ref readonly/in variable

Might be useful to enumerate any cases where (1) is true and then determine if (2) could be true for it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions