1

Is there any way to notify ReSharper that the return value of a local function is NotNull or CanBeNull?

Otherwise I need to convert local functions into member functions or turn off the pessimistic nullability checking because they produces tons of warnings.


EDIT

I know that attributes are not supported in local functions, but I wondered that there are any tricks instead.

For example, you can't put an attribute inside a method, but you can disable warning once with comment by writing // ReSharper disable once InconsistentNaming. I'm looking for a trick like this.

terborac
  • 323
  • 2
  • 13
  • 1
    MIght be relevant: https://github.com/dotnet/csharplang/issues/794 – Szabolcs Dézsi Feb 16 '19 at 01:44
  • Thank you, @SzabolcsDézsi! I know that attributes are not supported in local functions, but I wondered that there is any workaround instead. Please refer to the edited question. – terborac Feb 25 '19 at 01:23

0 Answers0