TypeScript does not treat a repeated property as “last declaration wins.” When an interface extends another interface, the child property must remain compatible with the inherited contract or TypeScript reports an error. With an intersection (&), both property types apply at once; they are not alternatives. Repeated interface declarations with the same name are a third case—declaration merging—with its own rules.
What happens when an interface extends another interface?
An interface extension describes a subtype relationship. A child can redeclare a property only if the resulting member is compatible with the inherited one; it cannot silently replace the base type. The TypeScript Handbook explains that incompatible same-name properties in interface composition produce an error: Object Types.
interface Base {
value: string;
}
interface Child extends Base {
value: number; // Error: incompatible with Base.value
}
The important point is compatibility, not whether the two types seem related by name or intent. TypeScript uses structural type compatibility, and assignment compatibility is the practical rule in many contexts, including extends clauses. See the Type Compatibility handbook page.
A compatible redeclaration can preserve the inherited contract. More subtle cases—such as optionality or narrower property types—depend on the types involved and the compiler version, so avoid assuming that every apparently narrower declaration is accepted.
#1 Best Overall
What happens to duplicate properties in an intersection?
An intersection means a value must satisfy both constituent types. If both sides declare the same property with different types, TypeScript does not choose one side: the property must meet both requirements. The handbook describes differently typed properties as being merged automatically in an intersection, which can lead to unexpected results when the type is used: Object Types.
type Both = { value: string } & { value: number };
declare const both: Both;
both.value; // must satisfy string and number
For ordinary values, no value is both a string and a number, so this property is effectively impossible to satisfy. That does not mean every conflicting intersection reduces as a whole to never. In particular, conflicting literal discriminants can cause the entire intersection to reduce; other conflicts may leave the intersection type present while making a property or assignment unusable. TypeScript 3.9 also documented stricter checks for intersections of concrete object types involving properties and optional properties; consult the version-specific TypeScript 3.9 release notes for that historical change.
Rank #2
- 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 types contribute compatible or distinct properties:
type Response = { data: string } & { requestId: string };
Here a value needs both data and requestId. The Unions and Intersection Types handbook page shows this composition pattern for combining shared and specific requirements.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11How is declaration merging different?
Two interface declarations with the same name are not an extension or an intersection. TypeScript merges them into one interface. For non-function members, duplicate names must have the same type; members with different types are an error. Same-name function members can instead contribute overload signatures, with later declaration groups generally placed before earlier ones. These rules are described in the handbook’s Declaration Merging section.
interface Settings {
mode: string;
}
interface Settings {
mode: string; // same type, so it can merge
debug: boolean;
}
This is useful context when reading declarations from multiple files or libraries: sharing an interface name intentionally opens it to merging. A type alias cannot be reopened in the same way. The older TypeScript 2.0 release notes explain that identical duplicate identifiers across declaration blocks are allowed, while duplicate definitions inside one block remain disallowed; that historical note does not permit conflicting same-block properties.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Which composition should you use?
| Choice | What a duplicate property means | Use it when |
|---|---|---|
interface Child extends Base |
The child member must be compatible with the inherited member; an incompatible declaration is reported as an error. | You are modeling a named subtype relationship. |
A & B |
The value must meet both property requirements; neither side overrides the other. | You are composing independent, compatible or distinct requirements. |
| Repeated interface declarations | Declarations merge. Duplicate non-function members must have the same type; function members can form overloads. | You intentionally want an interface to be augmented across declaration blocks. |
For an intentional property replacement, first remove the original key and then add the new one, rather than relying on an intersection to override it. For example, Omit can express the transformation:
interface Base {
value: string;
id: number;
}
type WithNumericValue = Omit<Base, "value"> & { value: number };
This constructs a new type without Base.value, then adds the replacement. Check the result with the TypeScript version used by your project, especially when optional properties or other compatibility-sensitive members are involved. The handbook’s Object Types discussion covers interface extension and intersection behavior.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Quick Recap
Best Value
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.




