File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -743,3 +743,29 @@ def test_we_can_bind_to_encoding_get_string():
743
743
744
744
data = '' .join (data )
745
745
assert data == 'Some testing string'
746
+
747
+
748
+ def test_wrong_overload ():
749
+ """Test regression in which implicit conversion caused the wrong types
750
+ to be used. See #131 for issue. Fixed by #137, #151"""
751
+
752
+ # Used to return `50L`
753
+ res = System .Math .Abs (50.5 )
754
+ assert res == 50.5
755
+ assert type (res ) == float
756
+
757
+ res = System .Math .Abs (- 50.5 )
758
+ assert res == 50.5
759
+ assert type (res ) == float
760
+
761
+ res = System .Math .Max (50.5 , 50.1 )
762
+ assert res == 50.5
763
+ assert type (res ) == float
764
+
765
+ res = System .Math .Max (System .Double (10.5 ), System .Double (50.5 ))
766
+ assert res == 50.5
767
+ assert type (res ) == float # Should it return a System.Double?
768
+
769
+ res = System .Math .Max (System .Double (50.5 ), 50.1 )
770
+ assert res == 50.5
771
+ assert type (res ) == float
You can’t perform that action at this time.
0 commit comments