MSVC fails C1202 on the bond export carrier
Table of Contents
This page is a capture in the inbox bucket of the product backlog — a pre-sprint idea, not yet pulled into a sprint as a story.
1. What
Both Windows MSVC jobs of continuous-windows.yml stop with fatal error
C1202: recursive type or function dependency context too complex in
rfl/internal/no_duplicate_field_names.hpp. The instantiation chain runs
from encode_instrument at instrument_payload.cpp:301 through
encode_leaf at instrument_payload.cpp:319 to the rfl::json::write
call at instrument_payload.cpp:81, with Leaf = bond_instrument_data. That struct is a hand-written export
carrier of 27 members, most of them other reflected structs. Writing a
variant with tags makes reflect-cpp build one literal over every field
name reachable from the alternative. Per the CI log, the bond carrier's
literal is past MSVC's limit; no local MSVC build has reproduced it. Restore the build by splitting how the bond carrier
is written, for example by writing its parts separately, as sprint 19 did
for the 502-name trade detail wrapper.
2. Why
Every continuous-windows.yml run on main from 2026-09-30 to 2026-10-02
fails. The run on 2026-10-02 at 17:36 shows the C1202 above. The hotfix
that restored the other red builds recorded this cause and left it
unowned. No Windows artefact can be built until it is fixed.
The limit is on the names reachable from one reflected literal, not on the members of one struct: 220 of the 287 reflected structs the models generate have more than nine members, some as many as 59, and they compile, because nothing tags them.
3. References
projects/ores.trading/api/src/domain/instrument_payload.cppprojects/ores.trading/api/include/ores.trading.api/domain/bond_instrument_data.hpp
4. See also
- Guard every reflected struct against the C1202 limit — the task that found the nine-member rule does not hold.