J2K: Insert initializer type for properties with primitive type if necessary

This commit is contained in:
Natalia Ukhorskaya
2015-12-17 18:01:17 +03:00
parent 188119aa83
commit 1d787ed222
12 changed files with 50 additions and 9 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ internal class Test {
}
fun test() {
val b = 10
val b: Byte = 10
putInt(b.toInt())
val b2 = 10
+1 -1
View File
@@ -5,7 +5,7 @@ internal class Test {
}
fun test() {
val b = 10
val b: Byte = 10
putInt(b.toInt())
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ package demo
internal class Test(i: Int) {
fun test() {
val b = 10
val b: Byte = 10
Test(b.toInt())
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
internal class Test {
val int: Int
get() {
val b = 10
val b: Byte = 10
return b.toInt()
}
}
+11
View File
@@ -0,0 +1,11 @@
class A {
public void foo() {
int i = 1;
byte b = 1;
short s = 1;
long l = 1;
double d = 1.0;
float f = 1.0f;
char c = 1;
}
}
+11
View File
@@ -0,0 +1,11 @@
internal class A {
fun foo() {
val i = 1
val b: Byte = 1
val s: Short = 1
val l: Long = 1
val d = 1.0
val f = 1.0f
val c: Char = 1.toChar()
}
}