Open chsienki opened 3 years ago
Related to #41171
Note this still occurs if the file correctly marks itself as generated via any of the heuristic methods.
I don't see why the compiler shouldn't issue the warning?
If the generated type is partial, then this could be a duplicate of https://github.com/dotnet/roslyn/issues/54103, and isn't specific to source generated files. Otherwise, then the compiler is correct about issuing a diagnostic IMO.
@chsienki Can you check if https://github.com/dotnet/roslyn/pull/56419 resolves this?
I see there are other aspects than what #56419 solves. (e.g: https://github.com/dotnet/runtime/issues/61379). But I think generator authors should produce a #pragma warning disable
s or properly generate documentation comments.
Not much convinced the compiler should special case generated code here.
This was also reported regarding [JsonSerializable] (in https://github.com/dotnet/roslyn/issues/60533). We should either have the source generator produce documentation, or do a compiler-level solution. Will chat offline
FWIW, I'm one of those odd birds that makes the compiler treat warnings like errors. Admittedly bit of a hardline approach, but muh code quality. Such draconian practices are duly rewarded by this breaking build.
Can we get an answer as to whether this warning should respect *.generated.cs or \
On a project with the
/doc:
option enabled, the compiler will issue a warning on code that is coming from a generated file. (see https://github.com/dotnet/runtime/pull/53275)A user can suppress the issue via a
.globalconfig
, but has no other recourse to fix the issue. Should we not fire CS1591 for generated code, or is it still a useful indicator to the user that types in their public API are going to have no documentation?