Methods generated by the compiler for records generate no warning when not listed in PublicAPI.(Un)shipped.txt. Adding the members by hand causes the analyzer to generate a RS0017 warning.
Steps To Reproduce
Define a record (with or without a primary constructor):
public record Person(string Name);
Apply the code fix for all RS0016 warnings.
Expected behavior
PublicAPI.Unshipped.txt should include public compiler-generated methods,
such as ToString(), Equals(), Deconstruct(), ==, etc.
Actual behavior
PublicAPI.Unshipped.txt only contains the type, constructor and property accessors.
Analyzer
Diagnostic ID: RS0016
Analyzer source
NuGet Package: Microsoft.CodeAnalysis.PublicApiAnalyzers
Version: 3.3.3 (Latest)
Describe the bug
Methods generated by the compiler for
record
s generate no warning when not listed in PublicAPI.(Un)shipped.txt. Adding the members by hand causes the analyzer to generate a RS0017 warning.Steps To Reproduce
record
(with or without a primary constructor):Expected behavior
PublicAPI.Unshipped.txt should include public compiler-generated methods, such as
ToString()
,Equals()
,Deconstruct()
,==
, etc.Actual behavior
PublicAPI.Unshipped.txt only contains the type, constructor and property accessors.