8000 Fix and test for overload resolution when last parameter takes a non-"params" array by omnicognate · Pull Request #201 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

Fix and test for overload resolution when last parameter takes a non-"params" array #201

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
Apr 9, 2016

Conversation

omnicognate
Copy link
Contributor

This fixes #200

@@ -304,6 +304,10 @@ def testValueParamsArgs(self):
self.assertTrue(result[1] == 2)
self.assertTrue(result[2] == 3)

def testNonParamsArrayInLastPlace(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

How about tests for the cases with params args & arrays?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean the case where there is a params keyword. If so, I believe that's covered by existing tests, eg. testObjectParamsArgs

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean don't you need to add in c# and check in python tests for the
following case below?

public static bool TestNonParamsArrayInLastPlace(int i1, params int[] ints)
{ return false; }

Maybe boolean return value needs to be changed to integer, since then there
are 3 overloaded cases.

On Wed, Apr 6, 2016 at 10:47 AM, omnicognate notifications@github.com
wrote:

In src/tests/test_method.py
#201 (comment):

@@ -304,6 +304,10 @@ def testValueParamsArgs(self):
self.assertTrue(result[1] == 2)
self.assertTrue(result[2] == 3)

  • def testNonParamsArrayInLastPlace(self):

Do you mean the case where there is a params keyword. If so, I believe
that's covered by existing tests, eg. testObjectParamsArgs


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/pythonnet/pythonnet/pull/201/files/4117162e2e98a0d2458c067ac7ea4b69e9a5d8e2#r58729780

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just tried it, but C# won't let me have both

TestNonParamsArrayInLastPlace(int i1, params int[] ints)

and

TestNonParamsArrayInLastPlace(int i1, int[] ints)

It says they have the same name and parameter types, error CS0111.

Copy link
Contributor

Choose a reason for hiding this comment

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

makes sense - no more questions! the answer as to why both are not allowed
is given here: http://stackoverflow.com/a/7580295/2230844

On Wed, Apr 6, 2016 at 11:29 AM, omnicognate notifications@github.com
wrote:

In src/tests/test_method.py
#201 (comment):

@@ -304,6 +304,10 @@ def testValueParamsArgs(self):
self.assertTrue(result[1] == 2)
self.assertTrue(result[2] == 3)

  • def testNonParamsArrayInLastPlace(self):

I just tried it, but C# won't let me have both

TestNonParamsArrayInLastPlace(int i1, params int[] ints)

and

TestNonParamsArrayInLastPlace(int i1, int[] ints)

It says they have the same name and parameter types, error CS0111.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/pythonnet/pythonnet/pull/201/files/4117162e2e98a0d2458c067ac7ea4b69e9a5d8e2#r58737494

@den-run-ai
Copy link
Contributor

@omnicognate can you squash (rebase) into one commit according to contributing guidelines? you can use sourcetree for GUI or plain git command-line to do this.

@omnicognate
Copy link
Contributor Author

I can do that but it will have to wait until I have something better than and xperia z2 to do it on :-)
I'll give it a go this evening, UK time.

@den-run-ai
Copy link
Contributor

you can try sgit app for android

On Wed, Apr 6, 2016 at 10:45 AM, omnicognate notifications@github.com
wrote:

I can do that but it will have to wait until I have something better than
and xperia z2 to do it on :-)
I'll give it a go this evening, UK time.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#201 (comment)

@omnicognate
Copy link
Contributor Author

That was an adventure (bit of a git n00b), but it's down to a single commit now.

7084

@tonyroberts tonyroberts merged commit 6b03bce into pythonnet:develop Apr 9, 2016
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
0