Skip to content

Allow trimming of events when event methods are not reflected over #102576

@sbomer

Description

@sbomer

From @MichalStrehovsky in #102528 (comment):

Another option could be to just stop doing the special behavior that looks for an event when an accessor is marked and let the event itself be trimmed. Only keep events that are visible targets of reflection (in that case consider the accessors reflection accessed as well).

I think there is an issue somewhere to do the same thing with properties. It's a bit more tricky for properties because debugger looks at them (we could only trim property metadata with DebuggerSupport=false), but events aren't surfaced in the debugger (and I don't see a future where they could be surfaced based on how event metadata works) so this shouldn't really affect debuggability and we can do it always.

This would simplify some of the special handling around events (see #102528 for full context).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Tools-ILLink.NET linker development as well as trimming analyzers

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions