Treat expect classes as not having implicit default constructors
#KT-15522 Fixed
This commit is contained in:
@@ -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
@@ -1,4 +1,4 @@
|
||||
expect class Printer {
|
||||
expect class Printer() {
|
||||
fun print(message: String)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user