Closed andyli closed 2 years ago
Still thinking on best resolution, but talking through the problem:
AsyncIterator was added to haxe more recently, so you can use --useSystemHaxe
and it'll map to the std lib of the currently install haxe (by default it uses stdlib for 4.0.5 but maybe --useSystemHaxe should be default)
However, enabling this doesn't solve the issue, because the haxe std lib extern doesn't have all the type parameters required:
// typescript
typedef AsyncIterator<T, TReturn, TNext> = { ... }
// haxe std lib
typedef AsyncIterator<T> = { ... }
dts2hx currently see's the stdlib AsyncIterator and decides not to use
So we probably have to generate an AsyncIterator anyway but it should be renamed to avoid the clash
This is fixed in 0.16.1, we still generate our version of AsyncIterator
because other types rely on the type parameters being correct but it's renamed to AsyncIterator_
Running your test build.hxml now passes for me, but I changed --macro include("js")
to --macro include("js.lib")
to avoid compiler issues with HxOverrides.hx
Works perfectly. Thanks!
@types/node
16.10.1build.hxml
To reproduce,
The cause is Haxe std lib defined
js.lib.AsyncIterator
instd/js/lib/Iterator.hx
, and somehow dts2hx generates anotherAsyncIterator
.