Issue2575
Created on 2017-04-02.18:03:45 by jamesmudd, last changed 2017-04-02.22:52:41 by zyasoft.
File name |
Uploaded |
Description |
Edit |
Remove |
Overloaded.java
|
jamesmudd,
2017-04-02.18:03:45
|
|
|
|
msg11291 (view) |
Author: James Mudd (jamesmudd) |
Date: 2017-04-02.18:03:45 |
|
If you import the attached Java class "Overloaded" which defines overloaded "test" and "testVarargs" methods for both int and boolean. When the methods are called in Jython the int versions are always called even when given a boolean argument e.g.
Jython 2.7.1rc1 (, Apr 2 2017, 17:16:05)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_121
Type "help", "copyright", "credits" or "license" for more information.
>>> import Overloaded
>>> o = Overloaded()
>>> o.test(True)
u'int:1'
>>> o.test(False)
u'int:0'
>>> o.test(11)
u'int:11'
>>> o.testVarargs(11, 12, 13)
u'ints...:[11, 12, 13]'
>>> o.testVarargs(True, True)
u'ints...:[1, 1]'
>>> o.testVarargs(True, True, False)
u'ints...:[1, 1, 0]'
There is a test around this area test_joverload but it doesn't seem to cover these cases.
This seems like quite a bad bug wondering if this is in fact expected?
|
msg11294 (view) |
Author: Jim Baker (zyasoft) |
Date: 2017-04-02.22:52:41 |
|
Likely a duplicate of #1781
|
|
Date |
User |
Action |
Args |
2017-04-02 22:52:41 | zyasoft | set | nosy:
+ zyasoft messages:
+ msg11294 |
2017-04-02 18:03:45 | jamesmudd | create | |
|