Feature request:
I'm finding the following attribute extremely error-prone, because we can't use nameof(...) in an attribute referring to a parameter in a method. If I mistype the string, the nullability analysis will go wrong, but I will never really know.

It would be nice to have an analyzer that detects compiler's nullable analysis that uses this nullability attribute generate a compiler warning when parameter names do not match with the strings.
Seems related to: https://github.com/dotnet/runtime/issues/33763
@buyaa-n @jeffhandley @bartonjs @stephentoub
dotnet/runtime#33763 is only for ArgumentException and its descendants constructor overloads having parameter of string. Assume this should apply for any class for any method with any ref type parameters having this attribute
Not sure if this can be added to the nullability analyzer itself, that seems more convenient to me, if that possible
This seems like it should really be a compiler warning. The compiler is doing the analysis and interpreting this attribute; if it's given something that doesn't make sense and it can't apply the intent of the developer, it should warn.
cc: @jcouv
@stephentoub that would be even better!
Most helpful comment
This seems like it should really be a compiler warning. The compiler is doing the analysis and interpreting this attribute; if it's given something that doesn't make sense and it can't apply the intent of the developer, it should warn.
cc: @jcouv