Skip to content

Generated C# is never compiled in tests and generated JavaScript is barely syntax-checked, so C# compile bugs slip through #162

Open

Description

@matt-edmondson

What's missing

Generated output is checked unevenly across targets:

  • C, C++, Rust and Go are compiled (*GeneratedSourceCompilesTests.cs, using CompiledExemplar.cs).
  • Python is imported (PythonGeneratedSourceImportsTests.cs).
  • JavaScript gets one node --check call, in JavaScriptGeneratorTests.CompleteImportItem_IsPassedThroughAndParses (~L43-64), which only covers an import line.
  • C# output is never compiled. Nothing in Coder.Test or Directory.Packages.props references Microsoft.CodeAnalysis.

Why it matters

The open C# compile bugs (#110, #126, #127, #155) are all things a compile step over the existing exemplar would have caught. The same class of regression in C# or JS reaches users unnoticed, while the four compiled targets catch it in CI.

Acceptance criteria

  • Add a CSharpGeneratedSourceCompilesTests that compiles the C# output of CompiledExemplar (and the shape fixtures the other compile tests use) with CSharpCompilation and asserts zero error diagnostics.
  • Run the JavaScript output of the same exemplar through node --check (as an .mjs module, skipping when node isn't available, as the other toolchain tests do).
  • Known failures can be marked expected, with links to their open issues, so the suite lands green and tightens as those issues close.

This also finishes the intent of implementation-plan Task 3.4 ("verify generated code compiles") for the targets added after it.

Activity

  1. added
    enhancement
    on Oct 5, 2026
  2. matt-edmondson commented on Oct 5, 2026

    @matt-edmondson
    ContributorAuthor

    Triage


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions