Generate compareTo() properly
Take into account: 1) resolved call to compareTo (instead of always calling Comparable's method) 2) types of both caller and callee, when primitive, to avoid wrong casting (instead of always using caller's type) #KT-3078 Fixed
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
fun box(): String {
|
||||
if (1 >= 1.9) return "Fail #1"
|
||||
if (1.compareTo(1.1) >= 0) return "Fail #2"
|
||||
if (1.9 <= 1) return "Fail #3"
|
||||
if (1.1.compareTo(1) <= 0) return "Fail #4"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user