Skip to content

Quantifiers not treated as literal characters given unnatural numberΒ #1531

Description

@codpro2005

Report a bug

πŸ”Ž Search Terms

ArkRegex,
regex,
quantifiers,
error

🧩 Context

  • ArkRegex version: 0.0.2
  • TypeScript version (5.1+): 5.9.3

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

Playground Link: https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzlApgcxQDzgXzgMyghDgHIBDKAaxgE8wVSBuAKBYGMIA7AZ3mwC8ydFgAUpAHrkEAWgCMOACSkAlADpgXfCihM4Aen1wAKvRRxNfclxjByt7hZ5ws7FDx7AAbigA2tOAATFBQwOGtAuEgPYAAjfwstTWAYFDVRACYAVgAOAE4VFkM4HgALCABXX0jYlAAuOE5efgaAIml5HFaObj44AKFUDExxKQQ5NSylVQ0tHT1i0wZEqxs7By4nF0w3GJ8E4NDwrkjoz3iAzXxk1PTs-MLissrquFqGpr7aBoADaTlFAg+FBNGgcFMfkA

import { regex } from 'arktype';

const x = regex('^a{-1}$').infer; // Type instantiation is excessively deep and possibly infinite.(2589)
// should be: const x: "a{-1}"
const y = regex('^a{1.5}$').infer; // Type instantiation is excessively deep and possibly infinite.(2589)
// should be: const y: `a{1${string}5}`

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status
Done (merged or closed)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions