package templateBuilders
//...
import org.w3c.dom.*
//...
external open class TemplateBuilder<T> {
open fun setBackgroundImage(image: Image): T
}
This compiles, but with wrong Image:
From TS compiler's view, this Image type should be resolved to custom defined interface
From KT compiler's view, it will be resolved to org.w3c.dom.Image, because we have star import import org.w3c.dom.* and no direct import for custom Image
We probably should generate something like this:
package templateBuilders
//...
import org.w3c.dom.*
import Image
//...
external open class TemplateBuilder<T> {
open fun setBackgroundImage(image: Image): T
}
The only reason why we don't generate it this way now is FQN of this Image -- it would be resolved as <ROOT>.Image, and we can't determine by this FQN if it's custom-defined or stdlib-defined. We probably should improve our FQN resolve logic
We would generate two files:
and
This compiles, but with wrong
Image
:Image
type should be resolved to custom defined interfaceorg.w3c.dom.Image
, because we have star importimport org.w3c.dom.*
and no direct import for customImage
We probably should generate something like this:
The only reason why we don't generate it this way now is FQN of this Image -- it would be resolved as
<ROOT>.Image
, and we can't determine by this FQN if it's custom-defined or stdlib-defined. We probably should improve our FQN resolve logic