dukat
dukat copied to clipboard
jQuery conversion generates "Overload resolution ambiguity"-prone methods
Converting jQuery doesn't yield any direct errors, but I was expecting to be able to write
jQuery("#foo")
as a result. However, this is invalid, as all of the four overloads match equally well:
@nativeInvoke
operator fun invoke(selector: String, context: Element? = definedExternally /* null */): JQuery
@nativeInvoke
operator fun invoke(selector: String, context: JQuery? = definedExternally /* null */): JQuery
@nativeInvoke
operator fun invoke(`object`: Any): JQuery
@nativeInvoke
operator fun invoke(html: String, ownerDocument: Document? = definedExternally /* null */): JQuery
/home/max/IdeaProjects/kiq
├── @types/[email protected]
└─┬ [email protected]
└── [email protected]
as a workaround, You can manually add
@nativeInvoke
operator fun invoke(selector: String): JQuery
This reproduces for kotlinx-nodejs 0.0.7 :(
fs.createReadStream(path)
Overload resolution ambiguity:
public external fun createReadStream(path: String, options: `T$50` = ...): ReadStream defined in fs
public external fun createReadStream(path: String, options: String = ...): ReadStream defined in fs
Buffer.alloc(size)
Overload resolution ambiguity:
public final fun alloc(size: Number, fill: Buffer = ..., encoding: String = ...): Buffer defined in Buffer.Companion
public final fun alloc(size: Number, fill: Number = ..., encoding: String = ...): Buffer defined in Buffer.Companion
public final fun alloc(size: Number, fill: String = ..., encoding: String = ...): Buffer defined in Buffer.Companion