Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ark/type/__tests__/declared.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { attest, contextualize } from "@ark/attest"
import { declare, type } from "arktype"
import { declare, type, type Out } from "arktype"
import { incompleteArrayTokenMessage } from "arktype/internal/parser/shift/operator/operator.ts"

contextualize(() => {
Expand Down Expand Up @@ -249,9 +249,9 @@ contextualize(() => {
"b?": "number"
})

attest<(In: { a: string; b?: number }) => Expected>(T.t).type.toString.snap(
"(In: { a: string; b?: number }) => Expected"
)
attest<(In: { a: string; b?: number }) => Out<Expected>>(
T.t
).type.toString.snap("(In: { a: string; b?: number }) => Out<Expected>")
})

it("morph out mismatch", () => {
Expand Down
4 changes: 2 additions & 2 deletions ark/type/declare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
show,
unset
} from "@ark/util"
import type { distill } from "./attributes.ts"
import type { distill, Out } from "./attributes.ts"
import type { type } from "./keywords/keywords.ts"
import type {
inferDefinition,
Expand Down Expand Up @@ -38,7 +38,7 @@ type finalizePreinferred<preinferred, def, $, ctx extends DeclareContext> =
ctx["side"] extends distill.Side ?
ctx["side"] extends "in" ?
(In: preinferred) => type.infer.Out<def, $>
: (In: type.infer.In<def, $>) => preinferred
: (In: type.infer.In<def, $>) => Out<preinferred>
: preinferred

export type DeclareContext = {
Expand Down