Skip to content

Improve "No constructor matches given arguments" message with more details #1143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2020

Conversation

lostmsu
Copy link
Member

@lostmsu lostmsu commented May 14, 2020

Similar to #900, but for constructors (reuses the same code moved around)

What does this implement/fix? Explain your changes.

This adds more details to "No constructor matches given arguments" message.

Was

No constructor matches given arguments

Now

No constructor matches given arguments for IntPtr: (int, list)

Does this close any currently open issues?

Does not close any issue, but is related to: #811, #265, #1116

…tails

Similar to pythonnet#900, but for constructors (reuses the same code)

Related issues: pythonnet#811, pythonnet#265, pythonnet#1116
@codecov-io
Copy link

codecov-io commented May 14, 2020

Codecov Report

Merging #1143 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1143   +/-   ##
=======================================
  Coverage   86.66%   86.66%           
=======================================
  Files           1        1           
  Lines         300      300           
=======================================
  Hits          260      260           
  Misses         40       40           
Flag Coverage Δ
#setup_linux 65.33% <ø> (ø)
#setup_windows 72.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 72fae73...72e6bf7. Read the comment docs.

var description = Runtime.PyObject_Unicode(type);
if (description != IntPtr.Zero)
{
to.Append(Runtime.GetManagedString(description));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If GetManagedString fails, you leak description

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, but I see that is not your doing but was already in the code...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@filmor it is still my doing :-D

@filmor filmor merged commit 6d2f0bd into pythonnet:master May 14, 2020
@lostmsu lostmsu deleted the PR/ConstructorNotFoundMessage branch May 14, 2020 19:42
AlexCatarino pushed a commit to QuantConnect/pythonnet that referenced this pull request Jun 29, 2020
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.

3 participants