JetBrains Rider 2026.1 Help

Code inspection: Type can be made file-local

This inspection reports a top-level type that is only used inside the same source file and can therefore be declared file. Using a file-local type keeps the API surface smaller and makes the intended visibility explicit.

Example

class Helper { } class Consumer { private readonly Helper _helper = new Helper(); }
file class Helper { } class Consumer { private readonly Helper _helper = new Helper(); }

Quick-fix

Change the type declaration to file.

29 March 2026