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

TypeScript does not treat a duplicate property as “last declaration wins.” When an interface extends another interface, a redeclared property must remain compatible with the inherited property or TypeScript reports an error. When types are joined with &, both property requirements apply at once; neither side overrides the other. Reopening an interface under the same name is a third, separate mechanism called declaration merging.

What happens when an interface extension repeats a property?

An extends clause describes a subtype relationship. The child interface must preserve the base interface’s contract, so it cannot silently replace an inherited property with an incompatible type. The TypeScript Handbook explains that incompatible same-name properties raise an error (Object Types: Interface Extension vs. Intersection).

interface Base {
  value: string;
}

interface Child extends Base {
  value: number; // Error: incompatible with Base.value
}

This is a compatibility check, not a rule that the child’s later declaration takes precedence. TypeScript’s compatibility model is structural: whether a property can be redeclared depends on whether its type satisfies the inherited requirement, not whether the types have similar names or share a relationship that looks plausible. The handbook distinguishes subtype and assignment compatibility and describes assignment compatibility as the practical mechanism used in many positions, including extends clauses (Type Compatibility).

A compatible redeclaration can retain the base property type. Some refinements may also be valid when the resulting property remains compatible with the base contract. Optionality and other edge cases depend on the types involved and compiler version, so avoid treating every related-looking type as a valid override.

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

What happens when an intersection repeats a property?

An intersection type, written with &, requires a value to satisfy both component types. If both sides declare the same property, the property must satisfy both requirements; TypeScript does not select one declaration as the winner. The handbook notes that differently typed properties are merged automatically in intersections, which can cause surprising results when the type is used (Object Types: Interface Extension vs. Intersection).

type Both = { value: string } & { value: number };

declare const both: Both;
both.value; // Must satisfy string and number

For ordinary types such as string and number, no normal value can satisfy both constraints. The conflict may therefore make the property impossible to provide, even though the intersection expression itself is legal to write. This does not mean every impossible property turns the entire intersection into never; reduction depends on the nature of the conflict. In particular, conflicting literal discriminants can cause the whole intersection to reduce. TypeScript 3.9 also documented stricter checks for intersections involving concrete object types and optional properties (TypeScript 3.9 Release Notes, published May 12, 2020).

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

Intersections are useful when the types contribute distinct or compatible members:

type Response = { data: string } & { requestId: string };

A value of Response must have both data and requestId. The TypeScript Handbook uses intersections to compose shared behavior with type-specific members (Unions and Intersection Types).

Free tools Windows power users keep installed

One-click scans. No signup required.

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

How is declaration merging different?

Two interface declarations with the same name are merged. This is different from one interface extending another and from combining types with &. For non-function members, duplicate names must have the same type; conflicting declarations produce an error. Same-name function members are accumulated as overloads, with later overload groups generally ordered before earlier groups. See the TypeScript Handbook’s Declaration Merging reference.

interface Settings {
  mode: string;
}

interface Settings {
  mode: string; // Same type: compatible duplicate
  debug: boolean;
}

The merged Settings interface includes both mode and debug. Changing the second mode declaration to a different type would not override the first; non-function members must agree. The TypeScript 2.0 release notes discuss identical duplicate identifiers across declaration blocks, but that historical allowance should not be read as permitting conflicting properties or duplicates within one declaration block (TypeScript 2.0 Release Notes, published September 22, 2016).

Which composition approach should you use?

Approach What it means for a shared property Best suited to
interface Child extends Base The child must keep the inherited property compatible; an incompatible declaration is an error. A named subtype relationship.
A & B The value must satisfy both property types simultaneously; there is no override. Composing independent types with distinct or compatible members.
Repeated interface Options declarations Non-function members with the same name must have identical types; function members can form overloads. Intentionally reopening and merging an interface declaration.

Interfaces can participate in declaration merging, while a type alias cannot be reopened in the same way. The handbook’s interface reference explains the distinction (Interfaces).

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

How can you intentionally replace a property type?

If a new type needs a different property contract, do not use an intersection as an override. Remove the original key from the type being composed, then add the new property declaration:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
interface Base {
  value: string;
  id: number;
}

type WithNumericValue = Omit<Base, "value"> & {
  value: number;
};

Here, Omit<Base, "value"> keeps the other base members but excludes the conflicting value; the intersection then adds the intended numeric property. This creates a transformed type rather than changing the original interface’s inheritance contract. Check the result with the TypeScript version used by your project, especially when optional properties or other compatibility-sensitive details are involved.

When do conflicts appear?

  • Interface extension: TypeScript reports an incompatible inherited-property declaration at the interface composition point.
  • Intersection: The type expression can exist even when a shared property is impossible to satisfy; problems may surface when assigning or using values of that type.
  • Declaration merging: Conflicting non-function members are rejected when the declarations are merged.

Exact diagnostics depend on the property types and compiler version. The TypeScript 3.9 release notes are a historical reference for changes to intersection checking, not a statement of the latest compiler version.

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.