Skip to content

Conversation

@gianmarco27
Copy link
Contributor

@gianmarco27 gianmarco27 commented Oct 17, 2025

Here i am once again!
The function overload definition edit suggested in #156 brought additional type errors in fastify because of how ts handles signatures overload.

thanos-thinking

What i did:

  1. Added more tests to reproduce the different usages.
  2. Tested reverting to the old function declarations that were in place before fix: enrich type definition of buildCompilerFromPool method #156, which failed the new tests.
  3. Tested various approaches with interface and types to try and preserve the function signature overloading logic.
  4. Finally changed approach to manually define a single function signature, with the type union for the specific parameter, without actually using signature overload.

It works, but what did it cost?

thanos-infinity-war

Checklist

@gianmarco27 gianmarco27 force-pushed the fix/function-overload branch from 4822a8e to 1e9de5b Compare October 17, 2025 22:43
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina requested review from Eomm and climba03003 October 18, 2025 11:03
Copy link
Member

@Eomm Eomm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense - but it was making sense before too 😄

@Eomm Eomm merged commit fa25c41 into fastify:main Oct 18, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants