The bug appears to stem from jsinterop.generator.visitor.DictionaryTypeVisitor#addFactoryMethod, which creates a wrapper JavaTypeReference around the provided Type. Instead, it should probably be a ParametrizedTypeReference in this case. Perhaps the addFactoryMethod can test if type has type params and if so create a ParameterizedTypeReference instance instead?
I didn't see a utility to generically create types like this, so perhaps this is the only use case for this, but maybe there are other synthetic methods that are created only to let Java do things that Js can natively do.
A few other examples in elemental2 - while making this list wI was looking for other places other than a create() method where this was a problem, but didn't spot any so far:
elemental2.dom.MessageEventInit
elemental2.dom.ITransformStream
elemental2.dom.ReadableStreamSource
elemental2.core.JsIIterableResult
elemental2.dom.TransformStreamTransformer
If the approach sounds reasonable, I can put together a sample patch to try fixing this?
A specific example of this is
elemental2.dom.CustomEventInit
, which at least as of elemental2 1.1.0 is generic onT
, but the factory method is raw:The bug appears to stem from
jsinterop.generator.visitor.DictionaryTypeVisitor#addFactoryMethod
, which creates a wrapperJavaTypeReference
around the providedType
. Instead, it should probably be aParametrizedTypeReference
in this case. Perhaps theaddFactoryMethod
can test iftype
has type params and if so create aParameterizedTypeReference
instance instead?I didn't see a utility to generically create types like this, so perhaps this is the only use case for this, but maybe there are other synthetic methods that are created only to let Java do things that Js can natively do.
A few other examples in elemental2 - while making this list wI was looking for other places other than a
create()
method where this was a problem, but didn't spot any so far:elemental2.dom.MessageEventInit
elemental2.dom.ITransformStream
elemental2.dom.ReadableStreamSource
elemental2.core.JsIIterableResult
elemental2.dom.TransformStreamTransformer
If the approach sounds reasonable, I can put together a sample patch to try fixing this?