Skip to content

Fix l1-proxy-index conformance test - #1008

Draft
iwahbe wants to merge 2 commits into
mainfrom
fix-l1-proxy-index
Draft

Fix l1-proxy-index conformance test#1008
iwahbe wants to merge 2 commits into
mainfrom
fix-l1-proxy-index

Conversation

@iwahbe

@iwahbe iwahbe commented May 12, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix the l1-proxy-index conformance test by addressing four codegen issues that prevented the generated dotnet program from compiling and producing the expected outputs.
  • Wrap inline map literals passed to Output.CreateSecret(...) in an anonymous record so they carry their own type at the call site.
  • PascalCase auto-generated config object class properties and annotate them with [JsonPropertyName(...)] to match traversal codegen while preserving JSON wire compatibility.
  • Bind config any/dynamic to System.Text.Json.JsonElement and emit .GetProperty("name") traversal for any variable transitively derived from such a config binding.
  • For MapType traversal sources, emit indexer (["key"]) access.

Test plan

  • make test_conformance (including the now-fixed TestLanguage/l1-proxy-index)
  • make test_codegen
  • make lint_language_host

iwahbe added 2 commits August 14, 2026 10:47
The previous codegen failed in four ways when generating the proxy-index
program:

* `Output.CreateSecret({"key": true})` emitted a bare collection
  initializer that is only legal as a property assignment, not as a
  function argument. Wrap inline object literals in an anonymous record
  so the call site stays self-typed.
* Auto-generated config classes used the wire-format property name
  directly, leading to a mismatch with the PascalCased traversal codegen.
  Emit the C# property in PascalCase and tag it with
  `[JsonPropertyName(...)]` so JSON deserialization continues to match
  the on-wire key.
* `config.RequireObject<dynamic>(...)` returns a `JsonElement` boxed as
  `dynamic`, after which dynamic dispatch (including `Output.CreateSecret`
  and lambda Apply) fails. Bind config `any` to `JsonElement` directly
  and route attribute traversal through `.GetProperty(...)` for any
  variable derived from one of these config bindings.
* Map literals reaching `Output.CreateSecret(...)` lost their key type,
  so make traversal pick indexer access for true `MapType` sources.
@iwahbe
iwahbe force-pushed the fix-l1-proxy-index branch from 558ab82 to 89817e9 Compare August 14, 2026 17:50
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.

1 participant