Fix JS compiler crash when translating external object fun with vararg

See KT-19793
This commit is contained in:
Alexey Andreev
2017-09-04 12:50:57 +03:00
parent 989cebe79e
commit 5a984a40e6
4 changed files with 34 additions and 0 deletions
@@ -0,0 +1,9 @@
Test = {
test: function() {
var sum = 0;
for (var i = 0; i < arguments.length; ++i) {
sum += arguments[i];
}
return sum;
}
};
@@ -0,0 +1,13 @@
// EXPECTED_REACHABLE_NODES: 995
import Test.test
external object Test {
fun test(vararg rest: Int): Int
}
fun box(): String {
val result = test(23, 42)
if (result != 65) return "fail: $result"
return "OK"
}