Skip to content

typed loads: the reverse member→snake_case rule has three copies (TypedLoadContract.ToSnakeCase, STJ SnakeCaseLower, YamlDotNet UnderscoredNamingConvention) and Core has no reverse of NameMangling.ToPascalCase #2136

Description

@antonsynd

Found by /verify-implementation plan-0ca7b7 (2026-09-26), measured @ 61bf20f with the built sharpyc; pre-existing at BASE acd1d40 unless noted.

R-CG (#2040) made NameMangling.ToPascalCase the single forward rule (snake → emitted member). 516bd7d routed toml's copy through it. The typed json/yaml doors map in the other direction, and there are three separate copies of that mapping:

  • TypedLoadContract.ToSnakeCase, which recovers the missing-field name from the CLR member;
  • Json.cs JsonNamingPolicy.SnakeCaseLower;
  • Yaml.cs UnderscoredNamingConvention.

These are the libraries' snake rules, not the inverse of R-CG. The affixed names that forced 516bd7d (x_ → X_, _x → _X) are the cells to probe: a field x_ loaded from {"x_": 4} must bind x_ and report x_ when missing. Needs a design: either a Core reverse rule, or the python-name channel stamped on the member ([SharpyName], R-CF) read by a custom naming policy.

Activity

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

    class-trackerThe one issue per class: carries the contract and the cell tablelane:silent-wrongCompiles and runs with wrong output or semantics (rank first)reach:probeNeeds an escaped spelling, a wrong-annotation probe or a python3 message diff

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions