|
From: James M. <re...@bu...> - 2017-04-02 18:03:53
|
New submission from James Mudd: 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? ---------- components: Core files: Overloaded.java messages: 11291 nosy: jamesmudd severity: normal status: open title: Overloaded int and boolean method incorrectly called type: behaviour versions: Jython 2.7 Added file: http://bugs.jython.org/file1574/Overloaded.java _______________________________________ Jython tracker <re...@bu...> <http://bugs.jython.org/issue2575> _______________________________________ |