Repository navigation
Improve generated Python constructor diagnostics - #230
Merged
leileizhang (lei9444) merged 1 commit intoOct 30, 2026
Merged
Conversation
Report supplied argument types and all projected constructor signatures on overload mismatch without changing dispatch or accepted calls. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mixed-language test coverageWorkflow status: ✅ Passed
|
shisan (qiutongMS)
approved these changes
Oct 30, 2026
leileizhang (lei9444)
deleted the
lei9444-python-constructor-diagnostics
branch
October 30, 2026 04:55
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
Generated Python runtime-class constructor mismatches now report the supplied positional argument types and keyword names/types, followed by all distinct candidate signatures. Candidate names and types reuse the existing constructor stub formatter; parameter values and internal module names are not printed.
The change runs only after existing constructor dispatch has failed. Argument binding, conversions, overload ordering, native activation errors, successful calls,
.pyioutput, named factories, andinspect.signature()are unchanged. No runtime helper or eager cross-module import is added.Reproduction
Generate a fresh Windows SDK Python package using the matching native runtime:
Before, both the wrong-keyword and wrong-type calls raise only
TypeError: No matching constructor for Uri.After:
Validation
aa3c43a1dc24108547e2e4cce0c995601be2af38in isolated outputs. Ran the same real-WinRT positive/negative cases on baseline and updated generated packages with that runtime.OSErrorpropagation. Diagnostics do not call argument repr, custom metaclass name hooks, or keyword formatting hooks..pyifiles are identical. JavaScript snapshots are unchanged.