Fix conversion of assignment as expression in J2K
Blockless if's and so with assignment as expression inside should turn into blockful #KT-16816 fixed
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
public class SomeClass {
|
||||
int a;
|
||||
int b;
|
||||
void doSomeWhile(int i) {
|
||||
do a = b = i; while (i < 0)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class SomeClass {
|
||||
internal var a: Int = 0
|
||||
internal var b: Int = 0
|
||||
internal fun doSomeWhile(i: Int) {
|
||||
do {
|
||||
b = i
|
||||
a = b
|
||||
} while (i < 0)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
public class SomeClass {
|
||||
void doSomeFor() {
|
||||
int a,b;
|
||||
for (int i = 0; i < 10; i++)
|
||||
a = b = i;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class SomeClass {
|
||||
internal fun doSomeFor() {
|
||||
var a: Int
|
||||
var b: Int
|
||||
for (i in 0..9) {
|
||||
b = i
|
||||
a = b
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
public class SomeClass {
|
||||
void doSomeIf(int i) {
|
||||
int a,b,c
|
||||
if (i < 0)
|
||||
a = b = i;
|
||||
else
|
||||
b = c = i;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
class SomeClass {
|
||||
internal fun doSomeIf(i: Int) {
|
||||
val a: Int
|
||||
val b: Int
|
||||
val c: Int
|
||||
if (i < 0) {
|
||||
b = i
|
||||
a = b
|
||||
} else {
|
||||
c = i
|
||||
b = c
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public class SomeClass {
|
||||
int a;
|
||||
int b;
|
||||
void doSomeWhile(int i) {
|
||||
while (i < 0)
|
||||
a = b = i;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class SomeClass {
|
||||
internal var a: Int = 0
|
||||
internal var b: Int = 0
|
||||
internal fun doSomeWhile(i: Int) {
|
||||
while (i < 0) {
|
||||
b = i
|
||||
a = b
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user