Nick
12/13/2023, 3:59 PMe: file:///Users/neddy/Development/Projects/doodle/Browser/src/jsMain/kotlin/io/nacular/doodle/HTMLElement.kt:116:27 Actual class 'Document' has no corresponding members for expected class members:
internal final expect fun createElement(localName: String, options: ElementCreationOptions /* = ElementCreationOptions */): Element /* = Element */
The following declaration is incompatible because actual function cannot have default argument values, they should be declared in the expected function:
public final fun createElement(localName: String, options: ElementCreationOptions = ...): Element
internal final expect fun createElementNS(namespace: String?, qualifiedName: String, options: ElementCreationOptions /* = ElementCreationOptions */): Element /* = Element */
The following declaration is incompatible because actual function cannot have default argument values, they should be declared in the expected function:
public final fun createElementNS(namespace: String?, qualifiedName: String, options: ElementCreationOptions = ...): Element
Is there some solution to make this work for aliasing impls with default parameters that cannot be changed?kirillrakhman
12/13/2023, 4:05 PMRoman Efremov
12/14/2023, 10:40 AMpublic actual class Document : org.w3c.dom.Document() {
But in such case you will hit "Overriding 'external' function with optional parameters", which you can fix by renaming methods createElement
and createElementNs
, if it's an option.
2. …or, if it's not an option, you can use delegation:
public actual class Document {
private val delegate = org.w3c.dom.Document()
internal actual fun createElement(localName: String, options: ElementCreationOptions): Element {
return delegate.createElement(localName, options)
}