百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
返回工具页/返回 Issues 列表
#1624·arktype

当返回值取决于未标注的参数时,Tuple morph 会推断 `.infer` 为 `never`

作者: Bas950创建于 2026年6月8日更新于 2026年6月8日

import { scope } from "arktype"

// ❌ tuple morph, parameter NOT annotated, return DEPENDS on the parameter // -> .infer (output) is never bug: ["Base", "=>", (d) => d],

// ✅ same morph with the parameter annotated -> .infer = { text: string } fixedByAnnotation: ["Base", "=>", (d: { text: string }) => d],

内容来源: arktypeio/arktype

查看 GitHub 原文在 GitHub 查看讨论