Open tlakollo opened 2 years ago
I've been looking into this as part of https://github.com/dotnet/linker/pull/3077 But I'm slow... maybe give me a couple more days - and I might be able to finish it.
I'm deciding if we should simply ignore these (the Kept validation logic already ignores a set of assembly-level attributes) and thus just extend this to the type definition as well, or if we should detect that it's in the input and "auto-Kept" them. What do you think?
I created this dirty hack to get over it in one of my PR's in runtime, not sure if we want this https://github.com/dotnet/runtime/pull/77149/commits/8c6a936a3a909d66cbc3437d34435b5b1a7dd677#diff-45dd6d8592d04a54955c62671ee19c45a463958d52ce5fb63fa519be0ae26508
Starting from RC2 compiler injects the attribute System.Runtime.CompilerServices.RefSafetyRulesAttribute to identify the language version. Since it's embedded into all modules the Kept logic will fail all tests that don't have the SkipKeptMemberAttribute on them, since it doesn't expect the RefSafetyRulesAttribute nor the associated types in the modules. Related to https://github.com/dotnet/runtime/issues/76032