diff --git a/ark/type/__tests__/declared.test.ts b/ark/type/__tests__/declared.test.ts index dacb352ce..d1bbb637b 100644 --- a/ark/type/__tests__/declared.test.ts +++ b/ark/type/__tests__/declared.test.ts @@ -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(() => { @@ -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>( + T.t + ).type.toString.snap("(In: { a: string; b?: number }) => Out") }) it("morph out mismatch", () => { diff --git a/ark/type/declare.ts b/ark/type/declare.ts index 36b86a02d..a2757cc5d 100644 --- a/ark/type/declare.ts +++ b/ark/type/declare.ts @@ -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, @@ -38,7 +38,7 @@ type finalizePreinferred = ctx["side"] extends distill.Side ? ctx["side"] extends "in" ? (In: preinferred) => type.infer.Out - : (In: type.infer.In) => preinferred + : (In: type.infer.In) => Out : preinferred export type DeclareContext = {