Skip to content

Preserve signed and unsigned WinRT enum backing types - #181

Merged
leileizhang (lei9444) merged 5 commits into
mainfrom
lei9444-pr-158-159-review
Sep 23, 2026
Merged

leileizhang (lei9444) merged 5 commits into
mainfrom
lei9444-pr-158-159-review

Conversation

@lei9444

@lei9444 leileizhang (lei9444) commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Preserve WinRT enums' Int32/UInt32 backing types through metadata parsing, runtime registration, and JavaScript/Python code generation.
  • Use the correct i4/u4 signatures for generic IIDs and preserve unsigned enum values across native calls, arrays, structs, collections, references, and callbacks.
  • Accept signed 32-bit bit patterns from JavaScript bitwise operations only for generated UInt32 flags-enum inputs, normalizing them to the corresponding unsigned value.
  • Keep plain UInt32 values, non-flags enums, and low-level UInt32 factories strict, rejecting negative, fractional, non-finite, and out-of-range values.
  • Add regression coverage for enum projections, SDK-compatible IIDs, native roundtrips, and invalid inputs.

Keep WinMD Int32/UInt32 backing types through runtime registration, generic IIDs, ABI marshaling, and JavaScript/Python projections. Preserve the signed default and cover high-bit values, collections, boxed references, struct fields, and callbacks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Mixed-language test coverage

Workflow status: ✅ Passed

Layer Lines Functions Branches/regions
Rust, including native .pyd/.node 86.44% 81.64% 86.1% regions
Python aggregate 71.06% n/a 37.9% branches
Python runtime 99.12% n/a 97.37% branches
Generated Python WinRT projections 70.05% n/a 27.07% branches
Generated Python WinRT implementations 72.3% n/a 47.04% branches
JavaScript aggregate 21.91% 25.18% 57.61% branches
JavaScript runtime 44.27% 45.76% 78.99% branches
Generated WinRT projections 22.8% 18.7% 54.84% branches
Generated WinRT implementations 45.99% 59.19% 60.97% branches
Generated Classic COM projections 11.88% 23.97% 53.4% branches

View workflow run and download full HTML/LCOV/XML reports

Resolve nested COM structs and arrays with COM enum metadata, preserve diagnostic handling of pointer-sized aliases, and resolve requested interfaces without parsing unrelated namespace members. Update enum expectations and add native-width regression coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Accept signed 32-bit bit patterns only for generated UInt32 flags enums while keeping plain UInt32 and low-level factories strict. Cover scalar, collection, array, struct, reference, fast-setter, and implementation callback paths.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Ignore incomplete Facade metadata candidates and fall back to the newest versioned Windows SDK metadata before asserting SDK enum contracts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Allocate WinRT flags helper names against module and parameter scopes. Preserve the validated UInt32 flags input policy in COM projections so signed JavaScript bit patterns normalize before strict native conversion. Add WinMD-to-JavaScript collision and file-dialog option regressions without invoking UI.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@lei9444
leileizhang (lei9444) merged commit 997379a into main Sep 23, 2026
33 checks passed
@lei9444
leileizhang (lei9444) deleted the lei9444-pr-158-159-review branch September 23, 2026 01:40
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.

2 participants