Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 358 Bytes

MA0150.md

File metadata and controls

13 lines (9 loc) · 358 Bytes

MA0150 - Do not call the default object.ToString explicitly

Report when ToString is called on an instance of a type that doesn't override ToString:

object o = ...;
o.ToString(); // compliant as ToString may be overridden

var o = new Foo();
o.ToString(); // Non-compliant as Foo doesn't override ToString and is sealed

sealed class Foo {}