Fix no-arg constructor generation for actual class

This commit is contained in:
Alexander Udalov
2018-04-25 11:17:58 +02:00
parent adb15d2d1a
commit c63cd430d1
7 changed files with 73 additions and 1 deletions
@@ -0,0 +1,31 @@
// !LANGUAGE: +MultiPlatformProjects
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: common.kt
expect class Foo(a: String = "", b: Int = 42)
// FILE: J.java
public class J {
public static void test() {
new Foo();
new Foo("", 42);
}
}
// FILE: jvm.kt
import kotlin.test.assertEquals
actual class Foo actual constructor(a: String, b: Int) {
init {
assertEquals("", a)
assertEquals(42, b)
}
}
fun box(): String {
J.test()
return "OK"
}