Repository navigation
Fix Python projection annotation aliases - #159
Merged
Merged
Conversation
Use consistent local and imported type names in generated handler, delegate, result, and struct annotations. Preserve same-named interfaces from other namespaces and standalone embedded struct names. Add collision and typing regression coverage without changing JavaScript output. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bdea384f-3022-47e8-8c74-11fd768c2105
Mixed-language test coverageWorkflow status: ✅ Passed
|
Bind standalone struct references to their actual declared names and compare canonical identities when excluding Python self imports. Add generic-versus-named collision regressions for standalone and packaged projections while preserving JavaScript output. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
shisan (qiutongMS)
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Use one consistent module-local and imported type-name mapping for Python handler, delegate, result, and ordinary annotations. Struct aliases now match
.py/.pyiimports, self-interface references use the local class name while same-name foreign interfaces remain imported, standalone embedded structs use local names, and nested default constructors remain valid.Add a focused Alpha/Beta collision fixture covering arrays, delegates, multi-results, and standalone class and struct cases, and document the naming invariants.
Scope and independence
This PR targets
mainand contains two commits affecting 11 codegen, test, and architecture-documentation files. It contains no collection runtime ordocs/status/TODO.mdchanges and is independent of the collection fix; the two PRs may merge in either order.JavaScript output and the intentional TypeScript nullable
ObjectgetManychange are untouched.Initial validation
The following validation was completed on the original fix before its cherry-pick; no builds, dependency installation, or test/CI reruns were performed for that initial PR preparation.
implementation_naming_test::python_handler_annotations_resolve_colliding_struct_and_interface_namespasses, including supported mypy checks and runtime type-hint resolution. The existingwinrt_implementation_test::implementation_python_projectionalso passes.At initial PR creation,
git diff --check, the exact 11-file scope, identical source contents, preserved commit trailers, and single-commit ancestry directly onmainwere verified.