Skip to content

Conversation

@simon-curtis
Copy link

Purely nice to have, added DynamicallyAccessedMembers metadata to remove the Class 'x' is never instantiated diagnostic is supressed

@simon-curtis
Copy link
Author

@microsoft-github-policy-service agree

@patriksvensson
Copy link
Contributor

@phil-scott-78 Could you take a look at this?

@phil-scott-78
Copy link
Contributor

I'll dig in tomorrow. I remember a debate a while back about maybe this working, but the team wanting it to stay with it only applying to Trimming so I didn't think it was ever done.

Is this working in VS or is it the Rider/R# analysis?

@simon-curtis
Copy link
Author

This is working in Rider, I don't use VS so I can't say if it works there too.

@phil-scott-78
Copy link
Contributor

huh, looks like last year they updated how their inspection works with DAM - https://youtrack.jetbrains.com/issue/RSRP-498196/DynamicallyAccessedMembers-attribute-not-taken-into-account-when-class-does-not-have-explicit-constructor

But I'm not sure we want to use that by-product to get the warning to go away. While I agree that this attribute should be on there for trimming support, I'm not sure what the impact would be on people using AOT and trimming right now, even unsupported. It should work, but my experience trying to get the Cli library to support AOT has been that a small change like that can really ripple a bunch of warnings at publish time very quickly.

That being said, when working through some documentation, I had the urge to update the Jetbrains ExternalAnnotations with [MeansImplicitUse] annotations for the Cli library. I think that might be the proper way to go about doing it.

Let me think about this. Open to other ideas too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants