Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 22, 2025

  • Understand the issue and explore codebase
  • Import bigInt64Array and bigUint64Array in AnyArbitraryBuilder.ts
  • Update typedArray function to include bigint typed arrays when withBigInt is true
  • Add test to verify bigint typed arrays are generated
  • Update documentation comment in QualifiedObjectConstraints.ts
  • Run tests to validate changes
  • Run lint and format to ensure code quality
  • Address code review feedback
  • Run security check with CodeQL (no issues found)
  • Verify implementation with comprehensive manual testing
  • Improve documentation to avoid consecutive "Also" statements
  • Add bigint typed array checks to isTypedArray helper function
Original prompt

fix #6293


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@changeset-bot
Copy link

changeset-bot bot commented Dec 22, 2025

⚠️ No Changeset found

Latest commit: c6f7557

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI changed the title [WIP] Fix issue with fast-check in specific scenarios ✨ Add bigint typed arrays to fc.anything() with withBigInt and withTypedArray Dec 22, 2025
Copilot AI requested a review from dubzzz December 22, 2025 14:35
@dubzzz dubzzz marked this pull request as ready for review December 22, 2025 14:49
Copilot AI review requested due to automatic review settings December 22, 2025 14:49
@dubzzz dubzzz added the 💥 Targeting v5 Breaking change that should be part of the major version 5. label Dec 22, 2025
@github-actions
Copy link
Contributor

👋 A preview of the new documentation is available at: http://69495ae3f2623a90f86eac8e--dubzzz-fast-check.netlify.app

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 22, 2025

@fast-check/ava

npm i https://pkg.pr.new/@fast-check/ava@6426

@fast-check/expect-type

npm i https://pkg.pr.new/@fast-check/expect-type@6426

fast-check

npm i https://pkg.pr.new/fast-check@6426

@fast-check/jest

npm i https://pkg.pr.new/@fast-check/jest@6426

@fast-check/packaged

npm i https://pkg.pr.new/@fast-check/packaged@6426

@fast-check/poisoning

npm i https://pkg.pr.new/@fast-check/poisoning@6426

@fast-check/vitest

npm i https://pkg.pr.new/@fast-check/vitest@6426

@fast-check/worker

npm i https://pkg.pr.new/@fast-check/worker@6426

commit: 3559014

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances fc.anything() to generate BigInt-based typed arrays (BigInt64Array and BigUint64Array) when both withBigInt: true and withTypedArray: true options are enabled, addressing issue #6293.

  • Conditionally includes bigint typed arrays in the typed array generation logic
  • Updates documentation to reflect the new behavior
  • Adds comprehensive test coverage to validate the feature works correctly

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/fast-check/src/arbitrary/_internals/builders/AnyArbitraryBuilder.ts Modified typedArray() function to accept withBigInt parameter and conditionally include bigInt64Array and bigUint64Array arbitraries
packages/fast-check/src/arbitrary/_internals/helpers/QualifiedObjectConstraints.ts Updated JSDoc comment for withTypedArray to document that bigint typed arrays are included when combined with withBigInt
packages/fast-check/test/unit/arbitrary/_internals/builders/AnyArbitraryBuilder.spec.ts Added test case to verify bigint typed arrays are generated with both flags, validation logic to ensure they're not generated otherwise, and helper function isBigIntTypedArray()

Comment on lines 95 to 96
* Also generate typed arrays in: (Uint|Int)(8|16|32)Array and Float(32|64)Array
* Remark: no typed arrays made of bigint
* Also includes BigInt64Array and BigUint64Array when withBigInt is enabled
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

The documentation has two consecutive lines both starting with "Also", which makes it less clear. Consider rephrasing to something like: "Also generate typed arrays including (Uint|Int)(8|16|32)Array, Float(32|64)Array, and BigInt64Array/BigUint64Array when withBigInt is enabled" for better readability and clarity.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the documentation to avoid consecutive "Also" statements for better clarity. Commit c6f7557

);
}

function isBigIntTypedArray(v: unknown): boolean {
Copy link
Owner

Choose a reason for hiding this comment

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

@copilot add biginttypedarray typeof checks in isTypedArray too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added BigInt64Array and BigUint64Array checks to the isTypedArray helper function. Commit c6f7557

Copilot AI requested a review from dubzzz January 8, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💥 Targeting v5 Breaking change that should be part of the major version 5.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make fc.anything({ withBigInt: true, withTypedArray: true }) generate bigint typed arrays

2 participants