-
Notifications
You must be signed in to change notification settings - Fork 752
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
Conversation
@@ -304,6 +304,10 @@ def testValueParamsArgs(self): | |||
self.assertTrue(result[1] == 2) | |||
self.assertTrue(result[2] == 3) | |||
|
|||
def testNonParamsArrayInLastPlace(self): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@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. |
I can do that but it will have to wait until I have something better than and xperia z2 to do it on :-) |
you can try sgit app for android On Wed, Apr 6, 2016 at 10:45 AM, omnicognate notifications@github.com
|
That was an adventure (bit of a git n00b), but it's down to a single commit now. |
This fixes #200