Skip to content

fix: Replace any with unknown in pool function return type#19

Merged
miccy merged 2 commits intosync/bun-migrationfrom
copilot/sub-pr-5-yet-again
Feb 3, 2026
Merged

fix: Replace any with unknown in pool function return type#19
miccy merged 2 commits intosync/bun-migrationfrom
copilot/sub-pr-5-yet-again

Conversation

Copy link

Copilot AI commented Feb 3, 2026

Code review identified that the internal pool function implementation used Task<any, any, any> as its return type, bypassing TypeScript's type safety.

Changes:

  • Changed pool function return type from Task<any, any, any> to Task<unknown, unknown> (packages/common/src/Task.ts:3306)

Impact:

The pool function is an internal implementation with typed overloads that provide correct types to callers. Using unknown instead of any enforces proper type narrowing at any potential call sites that bypass the overloads, while maintaining full compatibility with existing code that uses the typed overloads.

// Before: loses type safety
function pool<T, E>(
  tasksIterable: Iterable<AnyTask>,
  options: { ... }
): Task<any, any, any> { ... }

// After: requires type narrowing
function pool<T, E>(
  tasksIterable: Iterable<AnyTask>,
  options: { ... }
): Task<unknown, unknown> { ... }

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…k<unknown, unknown> for better type safety

Co-authored-by: miccy <9729864+miccy@users.noreply.github.com>
Copilot AI changed the title [WIP] Add internal documentation for Bun and Biome migration fix: Replace any with unknown in pool function return type Feb 3, 2026
Copilot AI requested a review from miccy February 3, 2026 18:02
@miccy miccy marked this pull request as ready for review February 3, 2026 18:06
@miccy miccy merged commit e72ca50 into sync/bun-migration Feb 3, 2026
@miccy miccy deleted the copilot/sub-pr-5-yet-again branch February 3, 2026 18:06
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.

2 participants