[release/8.0] Avoid marking property/event attributes multiple times (#92153)
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Mon, 18 Sep 2023 17:11:57 +0000 (10:11 -0700)
committerGitHub <noreply@github.com>
Mon, 18 Sep 2023 17:11:57 +0000 (10:11 -0700)
commit607bbcae163feefe855004bd404cf5564b755cd8
treed132d5cba15c12289c5ae657ba1c40c7aa53d65a
parentbcdff134478ad8df8014018cc4a2e67cc34fc452
[release/8.0] Avoid marking property/event attributes multiple times (#92153)

* Avoid marking property attributes multiple times

* Fix test for nativeaot

* Add issue link

* Simplify test, fix bug for events, add more coverage

* Fix event tests

* Fix test for nativeaot

NativeAot requires a call to GetCustomAttribute for the
attributes to be kept.

---------

Co-authored-by: Sven Boemer <sbomer@gmail.com>
src/tools/illink/src/linker/Linker.Steps/MarkStep.cs
src/tools/illink/src/linker/Linker/Annotations.cs
src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/AttributePropertyDataflow.cs
src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/TypeHierarchyReflectionWarnings.cs
src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/BasicRequires.cs
src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnAttribute.cs
src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnClass.cs