DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk3 min

How to Resolve Conflicting Property Types in TypeScript Intersections

TypeScript intersections combine requirements rather than override properties. Use Omit to replace a key, unions for alternatives, and interface extension for compatible contracts.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In TypeScript, an intersection does not let the right-hand type override the left. A & B requires a value to satisfy both types, so conflicting property declarations can make that property never. To intentionally change a property, remove it from the original type with Omit before adding its replacement.

Why an intersection creates a conflict

An intersection combines requirements: a value of type A & B must satisfy both A and B. If both types declare the same property with incompatible types, TypeScript combines those property requirements rather than choosing one. The result can be a property of type never, meaning no ordinary value can satisfy it. See the TypeScript Handbook’s explanation of object intersections.

As an Amazon Associate I earn from qualifying purchases.

type Person1 = { name: string };
type Person2 = { name: number };
type Staff = Person1 & Person2;

// Staff.name must be both string and number.
// No ordinary value can satisfy both, so the property is never.

When a property becomes unusable, ask whether the intended value should really satisfy both constraints. If it should not, the intersection likely represents the wrong relationship.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Replace a property with Omit

When a derived type should keep the rest of a base shape but deliberately change one property, exclude that key first and then add the new declaration. TypeScript’s utility types reference documents Omit for constructing a type while excluding selected keys.

type ApiRecord = {
  id: string;
  value: number;
};

type DisplayRecord = Omit<ApiRecord, "value"> & {
  value: string;
};

DisplayRecord retains id, removes the original value: number requirement, and adds value: string. Because the old declaration is no longer part of the intersection, the two types do not compete for the same property.

Choose a union when the value has alternatives

If a value can have one shape or another, use a union (|) rather than an intersection (&). A literal discriminant such as kind lets TypeScript narrow the type based on which alternative is present; the Handbook’s narrowing guide explains this pattern.

Rank #2
TypeScript Programming Language - Software Engineer & Coder T-Shirt
  • TypeScript implements a superset of syntax for strictly typed development, facilitating deep static analysis and enhanced development environment integration. The compiler translates source into standard script formats, ensuring parity across any runtime.
  • TypeScript is ideal for front-end developers, full-stack engineers, and software architects who build large-scale web applications. It serves those looking to improve code excellence, reduce bugs through static checking, and maintain complex projects more.
  • Lightweight, Classic fit, Double-needle sleeve and bottom hem
type Circle = { kind: "circle"; radius: number };
type Square = { kind: "square"; sideLength: number };
type Shape = Circle | Square;

function area(shape: Shape): number {
  if (shape.kind === "circle") {
    return Math.PI * shape.radius ** 2;
  }
  return shape.sideLength ** 2;
}

Here, a shape is a circle or a square, not both simultaneously. Checking kind narrows the union so each branch can use its corresponding property.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use interface extension for compatible contracts

Interfaces are useful when declarations are intended to extend one shared contract and a conflicting property should be caught as an error. The Handbook distinguishes this from intersections: incompatible same-name properties in interface extension produce an error, while intersections combine the property requirements and may produce never. Use extension when that early conflict check better expresses your intent; use Omit when the change is deliberate.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How TypeScript version affects the diagnostic

TypeScript 3.9 introduced stricter checking for intersections and documented that an impossible intersection with conflicting discriminant properties can reduce to never as a whole. As a result, some compiler diagnostics may say that a property does not exist on never, rather than simply displaying that individual property as never. The TypeScript 3.9 release notes describe the change.

Pick the type construction that matches the intent

What you mean Use Why
A value must meet every requirement Intersection (A & B) All constituent constraints apply.
One property is intentionally redefined Omit<Base, "key"> & { key: NewType } Removes the old key before adding its replacement.
A value may have one of several shapes Union (A | B), often with a discriminant Models alternatives and supports narrowing.
Declarations extend one contract and incompatibilities should fail Interface extension Reports incompatible extended properties as errors.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.