Skip to content

Nested bigints are printed as strings in error messagesΒ #1477

Description

@aweebit

Report a bug

πŸ”Ž Search Terms

bigint

🧩 Context

  • ArkType version: 2.1.20 (latest)
  • TypeScript version (5.1+): 5.8.3

πŸ§‘β€πŸ’» Repro

Playground Link: https://arktype.io/playground?code=import%2520%257B%2520type%2520%257D%2520from%2520%27arktype%27%253B%250A%250Aconst%2520Thing%2520%253D%2520type%28%27bigint%255B%255D%27%29.narrow%28%28arr%252C%2520ctx%29%2520%253D%253E%2520%257B%250A%2520%2520return%2520new%2520Set%28arr%29.size%2520%253D%253D%253D%2520arr.length%2520%257C%257C%2520ctx.mustBe%28%27free%2520of%2520duplicates%27%29%253B%250A%257D%29%253B%250A%250Aconst%2520out%2520%253D%2520Thing%28%255B1n%252C%25200n%252C%25201n%255D%29%253B

import { type } from 'arktype';

const Thing = type('bigint[]').narrow((arr, ctx) => {
  return new Set(arr).size === arr.length || ctx.mustBe('free of duplicates');
});

const out = Thing([1n, 0n, 1n]);

The code results in the following errors summary:

must be free of duplicates (was ["1n","0n","1n"])

But the expected output would be this:

must be free of duplicates (was [1n,0n,1n])

Activity

  1. added
    bug
    on Jul 6, 2025
  2. added a commit that references this issue on Sep 29, 2026
    27ad991
  3. added a commit that references this issue on Oct 1, 2026
    1ee4923
  4. added a commit that references this issue on Oct 2, 2026
    89ee4c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

  • Status
    Done (merged or closed)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions