Treat expect classes as not having implicit default constructors

#KT-15522 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-09-27 15:56:41 +03:00
parent 887e71a7c1
commit f3344ec2b2
29 changed files with 145 additions and 50 deletions
@@ -1,5 +1,5 @@
actual class Foo(x: Int) {
actual constructor() : this(0)
constructor() : this(0)
val x: Int = x
}
@@ -5,10 +5,10 @@ Output:
-- JVM --
Exit code: COMPILATION_ERROR
Output:
compiler/testData/multiplatform/incorrectImplInClass/jvm.kt:1:25: error: actual constructor of 'Foo' has no corresponding expected declaration
actual class Foo actual constructor() {
^
compiler/testData/multiplatform/incorrectImplInClass/jvm.kt:2:12: error: actual constructor of 'Foo' has no corresponding expected declaration
The following declaration is incompatible because number of value parameters is different:
public constructor Foo()
actual constructor(s: String) : this()
^
compiler/testData/multiplatform/incorrectImplInClass/jvm.kt:4:5: error: actual function 'nonPlatformFun' has no corresponding expected declaration
+1 -1
View File
@@ -1,4 +1,4 @@
expect class Printer {
expect class Printer() {
fun print(message: String)
}