Summary
A number written any way but plain decimal is typed unknown:
export const TIMEOUT_MS = 30_000
export const MASK = 0xff
export const EPSILON = 1e-9all come out unknown, and so does a let, an object property, a parameter default or a class field initialized that way (export function wait(ms = 1_000) gives ms?: unknown), and BigInts such as 0xffn or -1_000n. Stacks' own config/commerce.ts tiers (upTo: 25_000, step: 1_000) and router readJsonBody(request, maxBytes = ...) are among the outputs hit.
Changes
Both copies of isNumericLiteral, in processor/type-inference.ts and extractor/scanner.ts, accepted only -?\d+(\.\d+)?, and the BigInt check only decimal digits. isNumericLiteral now reads separators between digits, an exponent, a leading or trailing dot, and hexadecimal, binary and octal numbers, as the Zig port's isNumericLiteral already does. The scanner imports it instead of keeping its own copy, and isBigIntLiteral takes the same digits. A spelling the language rejects, such as 0_1 or 1__0, is still left alone, and the legacy 07 is read as before.
Each spelling is emitted as written (export declare const MASK: 0xff;), which is a valid literal type equal to its value.
Testing
New test/numeric-literal-spellings.test.ts covers each spelling in a const, a let, an object property, a parameter default, a class field and a static readonly constant, BigInts, malformed spellings that must stay unknown, and a consumer type-checked with the existing runTsc helper (const a: 30000 = TIMEOUT_MS, const b: 255 = MASK, const d: 255n = BIG). 15 of its 18 cases fail on main, with the output unknown; the 3 that pass there are the malformed-spelling guards. All pass with the fix.
bun test (Zig library built with the pinned Zig, so its tests run too), typecheck, lint, zig build test and the Zig fixture tests pass. Over 4,192 files from vue-core, vue-router, pinia and knip nothing changes; over 11,773 more from tailwindcss, stacks, eslint-plugin-vue and home, 28 outputs change, each an unknown becoming the number type, and strict tsc reports the same errors for those 28 before and after.