You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bind desugared records by constructor order, not field order
The first attempt fixed only the single-component defs. On a device the dex
format stores a class's fields sorted by name, so getDeclaredFields() is
alphabetical: BirdDef's 13 components no longer matched any constructor
signature and were rejected, while UpgradesDef(trees, nodes) — two List
components — matched by type in the wrong order and would have bound nodes
into trees. Field order is unusable, and trusting it is worse than failing.
StrictBinder now finds the canonical constructor by the multiset of its
parameter types (order-independent) and takes the component order from that
constructor, mapping each parameter to its field by name; -parameters is
added to the Android javac so the names survive, as they already do on the
desktop build. A parameter that resolves to neither a name nor a uniquely
typed field yields no components at all rather than a guess.
StrictBinderDesugarTest now hands the fields over in dex order and asserts
the components still equal the record reading, so the alphabetical case is
covered on the JVM.
versionCode 5 -> 6; versionName stays 0.1.1.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017R4Qc2xhRcuWXcz5648DZA