Fixed KT-5315 J2K: Generate local var when parameter is being assigned

#KT-5315 Fixed
This commit is contained in:
Valentin Kipyatkov
2014-06-25 00:48:53 +04:00
parent 427280a365
commit 8512eac768
10 changed files with 120 additions and 28 deletions
@@ -0,0 +1,6 @@
//method
int foo(int p1, int p2, int p3) {
p1++;
if (p2 > 0) p3 = 0;
return p1 + p2 + p3;
}
@@ -0,0 +1,7 @@
fun foo(p1: Int, p2: Int, p3: Int): Int {
var p1 = p1
var p3 = p3
p1++
if (p2 > 0) p3 = 0
return p1 + p2 + p3
}
@@ -2,6 +2,7 @@ package demo
class Test() {
fun test(vararg args: Any) {
var args = args
args = array<Int>(1, 2, 3)
}
}
@@ -1,9 +0,0 @@
//file
package demo;
class Test {
int test(int i) {
i = 10;
return i + 20;
}
}
@@ -1,8 +0,0 @@
package demo
class Test() {
fun test(i: Int): Int {
i = 10
return i + 20
}
}