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
The culprit function is defined as follows:
Running
The package exports defined in
Some things I have learnt already:
- This is due to the
- The error is only reported when I export it as part of
- Using a
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.
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.
