Did 1.7.20 change anything around default parameters between expect/actual classes?
I have a project where the
expect
class’s contructor would have default parameter. The actual class would not set this parameter. It used to be fine unless I build the project using 1.7.20
It gives me the constructor doesn’t pass the defaulted param.
Copy code
// commonMain
expect abstract class Foo(
sourceFile: String? = null,
) {}
// nativeMain
actual abstract class Foo actual constructor(
actual val sourceFile: String?,
) {}
// nativeMain
actual abstract class Bar protected actual constructor(
) : Foo() {} // This would complain `sourceFile` isn't passed in the constructor of `Foo`
r
russhwolf
10/26/2022, 6:40 PM
What's the expect declaration look like for
Bar
?
b
Benoit Quenaudon
10/26/2022, 6:48 PM
Something like
Copy code
expect abstract class Foo protected constructor(
) : Foo {}