Rikki Gibson
Rikki Gibson
@jmarolf raised the question of whether it would make sense to introduce a TFM specifically for analyzers--basically netstandard2.0 minus the APIs we don't want you to use. The TFM would...
It will be possible to suppress the banned API errors. Hopefully, though, seeing the error will lead the user to investigate whether there is another way to do what they're...
Implemented in dotnet/roslyn-analyzers#6115
Could you please share the original scenario from roslyn?
It looks like the reason that extending `MemberNotNullWhen` is listed as an alternative and not the primary proposal is because it feels imprecise/awkward to use `[MemberNotNullWhen(true, "AsA()")] bool IsA;`. Is...
> Backwards analysis like this proposes isn't feasible. We need to know when IsA is called to update the info for AsA(). It feels like the attribute can be placed...
MemberNotNull [doesn't work across inheritance](https://sharplab.io/#v2:EYLgtghglgdgPgYhgVwDaosVBTABNmTHAWACgyABABlwoEYA6AESggHMYB7AZwBcoAxtwYBhTgBNsAQUKoAntyjcA3GUoBmWgCZcAIQjc8ZAN5lc52pvpUA/LgDKq0gF81pClZ0jcIPQbym5KQWuADaALLYYMDYAE4Acpy88WioABQARPYZAJQAumYWHrQALLjhaTm4gSGuwUWaIpWF5jUhFhU5Tu0W9gwAKpz2vLGwbJXdFnV1QA===). I don't think there's a need to support inheritance as a part of solving this issue. Regarding changing states of nested members: that's interesting. I'd...
All that said, I'm not a strong supporter of introducing NotNullWhenMember, at least until I better understand what it would take to make MemberNotNull able to refer to methods unambiguously...
That looks like a case where MemberNotNullWhen (already existing) would work.
I randomly found myself thinking about this issue and observed that the nature of the ambiguity in https://github.com/dotnet/csharplang/issues/2926#issuecomment-672074053 is similar to an ambiguity observed with *collection literals* (#5354). ```cs M(x...