Inconsistent type checking of overloaded generic functions on publish
Hi, thanks for taking the time to read this.
I'm running into inconsistent type checking behaviour of overloaded generic functions between
deno check
and deno publish
. I would expect both to exhibit the same kind of type checking behaviour but it seems I've found an edge-case.
The culprit function is defined as follows:
Running deno check
reports no type errors. However, using deno publish
it reports the following error:
The package exports defined in mod.ts
have chain
exported as a simple re-export: export { chain } from '...';
.
Some things I have learnt already:
- This is due to the noUnusedParameters
compiler option, disabling said option removes the type error.
- The error is only reported when I export it as part of mod.ts
(i.e. only when it is 'exported publicly').
- Using a @ts-ignore
rule mitigates the type error.
Of course I could refactor to avoid the use of overloads but I figured this might be worth investigating.
Once again, thanks for taking the time to read into this. If anything remains unclear, I'd be more than happy to provide more information.2 Replies
Can you file an issue for that (copy & paste your message) here https://github.com/denoland/deno/issues ?
I’ve created the following issue: https://github.com/denoland/deno/issues/30285
GitHub
Inconsistent type checking of overloaded generic functions on publi...
Version: Deno v2.4.3 Hi, thanks for taking the time to read this. I'm running into inconsistent type checking behaviour of overloaded generic functions between deno check and deno publish. I wo...