arktype icon indicating copy to clipboard operation
arktype copied to clipboard

Type is not assignable to type when using `.or()` on a `type()` passed as parameter of `type().and()`

Open Fleny113 opened this issue 1 year ago • 0 comments

Report a bug

🔎 Search Terms

Typescript 5.5

🧩 Context

  • ArkType version: 2.0.0-dev.11
  • TypeScript version: 5.4.5, 5.5.0-beta
  • Other context you think may be relevant (Node version, OS, etc.): Node v22

🧑‍💻 Repro

import { type } from "arktype"

const badType = type({
  someField: "string"
})
  .and(
    type({
      action: "'a' | 'b'"
    })
    .or({
      action: "'c'"
    })
  );

Fleny113 avatar May 07 '24 20:05 Fleny113