NJ2K: fix implicit type cast in binary expressions

#KT-37298 fixed
This commit is contained in:
Ilya Kirillov
2020-05-29 21:24:34 +03:00
parent d5d57f84e0
commit 08e2dd3dea
4 changed files with 40 additions and 1 deletions
@@ -0,0 +1,11 @@
class A {
void acceptDouble(double d) {}
void acceptDoubleBoxed(Double d) {}
public void conversion() {
int a = 10;
float b = 0.7f;
acceptDouble(a * b)
acceptDoubleBoxed(a * b)
}
}
@@ -0,0 +1,10 @@
internal class A {
fun acceptDouble(d: Double) {}
fun acceptDoubleBoxed(d: Double?) {}
fun conversion() {
val a = 10
val b = 0.7f
acceptDouble((a * b).toDouble())
acceptDoubleBoxed((a * b).toDouble())
}
}