Skip to content

Union with common merge child doesn't find error in child #1587

Closed

Description

@FredMcAwesome

Report a bug

🔎 Search Terms

Merge

🧩 Context

System:
OS: Linux 6.14 Fedora Linux 40 (Workstation Edition)
CPU: (16) x64 AMD Ryzen 7 7700X 8-Core Processor
Memory: 12.75 GB / 30.48 GB
Container: Yes
Shell: 5.2.26 - /bin/bash
Binaries:
Node: 24.12.0 - /home/tk_linux/.nvm/versions/node/v24.12.0/bin/node
npm: 11.6.2 - /home/tk_linux/.nvm/versions/node/v24.12.0/bin/npm
npmPackages:
@ark/schema: 0.56.0
@ark/util: 0.56.0
arktype: 2.1.29
typescript: 5.8.3

🧑‍💻 Repro

Playground Link

import { type } from "arktype"

const FinalSchema = type({
	"+": "reject",
	"category?": "number"
})

const { NestedSchema } = type.module({
	LocalFinalSchema: FinalSchema,
	MergedSchema: "Merge<LocalFinalSchema, NestedSchema>",
	NestedSchema: {
		"+": "reject",
		"inner?": "MergedSchema"
	}
})

const ParentSchema = NestedSchema.merge({
	"+": "reject",
	"test1?": "string"
})

const OtherParentSchema = NestedSchema.merge({
	"+": "reject",
	"test2?": "string"
})

const Thing = type.or(ParentSchema, OtherParentSchema)

const out = Thing({
	inner: {
		category: "Test"
	}
})

We do not receive an error for using a string instead of a number for category.

Activity

  1. added
    bug
    on Feb 11, 2026
  2. pullfrog commented on Feb 11, 2026

    @pullfrog
    Contributor
  3. ssalbdivad commented on Nov 18, 2026

    @ssalbdivad
    Member

    Fixed in 3.0.0-beta.0 (#1728). Try it with npm i arktype@next.

  4. moved this from To do to Done (merged or closed) in arktypeioon Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

  • Status
    Done (merged or closed)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions