Skip to content

Suppress documentation and obsolete warnings in generated wrappers - #349

Merged
akeit0 merged 1 commit into
mainfrom
codex/issue311-generated-warnings
Oct 10, 2026
Merged

akeit0 merged 1 commit into
mainfrom
codex/issue311-generated-warnings

Conversation

@akeit0

@akeit0 akeit0 commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Generating a public [LuaObject] with XML documentation enabled currently produces CS1591 for its generated implicit conversion. Exposing obsolete members also produces CS0612/CS0618 at the generated wrapper's call sites. These generated warnings can break builds that treat warnings as errors.

Suppress CS1591, CS0612 and CS0618 inside generated files, with matching restore directives and comments explaining the scope. This follows the existing generator warning policy and the precedent in .NET's COM generator and JSON generator. Handwritten code retains its documentation and obsolete-use diagnostics; Obsolete(..., true) errors remain errors. Generated runtime code and public API signatures are unchanged.

Fixes #311.

Validation:

  • Added 11 compilation regression cases covering public class/generic class/record documentation, normal and error-level warnings, obsolete fields/properties/methods/metamethods, preserved diagnostics in user code, and preserved CS0619 errors. Against main, 10 of these cases fail; all pass with the fix.
  • Source Generator tests: 12 passed locally. Runtime Release tests excluding ExpectedFailure: 322 passed.
  • GitHub Actions lint and runtime test jobs passed for commit fb33179.
  • External consumer rebuild with documentation generation enabled and CS1591 treated as an error: netstandard2.1/net6.0/net8.0/net10.0 all succeed with zero warnings/errors. Main fails with 12 CS1591 errors on the same consumer.
  • Formatting and diff checks pass. Temporary consumer projects, generated-source probes and logs remain outside git.

This PR remains unmerged for review.

@akeit0
akeit0 merged commit a23f1a1 into main Oct 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated source code causes CS1591 warnings if GenerateDocumentationFile is true

1 participant