Back to News & Insights
Web Development October 3, 2026 · 12 min read

TypeScript `interface` Extends vs Intersection: When the Difference Actually Breaks Your Code

TypeScript interface Extends vs Intersection: When the Difference Actually Breaks Your...

TypeScript `interface` Extends vs Intersection: When the Difference Actually Breaks Your Code

TypeScript interface Extends vs Intersection: When the Difference Actually Breaks Your Code

This article was written with the assistance of AI, under human supervision and review.

Most TypeScript type errors stem from treating interface extends and intersection types (&) as interchangeable syntax. The critical distinction is that extends validates property conflicts at declaration time, while & defers validation until use, permitting silent incompatibilities that manifest as runtime failures. Teams discover this the hard way when API responses typed with intersections accept malformed data that crashes application logic.

The problem compounds in large codebases. A developer extends an interface with a conflicting property, the compiler immediately reports the error at the declaration site. Another developer uses an intersection type for the same scenario, sees no error, commits the code, and the type system permits values that violate application invariants. The distinction between "compiler catches this now" and "compiler permits this until someone actually uses it wrong" determines whether bugs surface during development or in production.

Understanding when to use each mechanism eliminates an entire class of type safety failures. This post covers the declaration-time versus use-time checking model, the performance implications of interface caching, and the specific scenarios where choosing the wrong tool produces silent bugs.

Key Takeaways interface extends validates property conflicts at declaration time, while & defers validation until use, permitting incompatible types to compile. The TypeScript compiler caches interface hierarchies, making extends faster than intersection re-evaluation in large codebases. Intersection types create union types for conflicting properties, not compile errors, allowing runtime type mismatches. API response typing with intersections permits malformed data that crashes application logic when property types conflict. Interface extension enforces a single source of truth for property types, preventing silent incompatibilities in shared models.

The semantic difference between interface extends and intersection types determines when TypeScript validates type compatibility. Interface extension performs structural validation at the point of declaration. When an interface extends another interface, the compiler immediately checks that all properties in the child interface are compatible with the parent. If property types conflict, the build fails before any code uses the types.

Intersection types defer this validation. When developers combine types with &, the compiler creates a new type that represents values satisfying both constraints. Critically, the compiler does not validate property compatibility at the intersection definition. Conflicting property types produce a union of those types, not a compile error. The validation occurs only when code attempts to assign a value to the intersection type.

This distinction matters for property conflicts. Consider an interface Base with a property id: string and a derived type that attempts to narrow id to a more specific type. With extends, the compiler rejects incompatible narrowing immediately:

The error surfaces at the declaration site. Developers cannot use Derived anywhere in the codebase until they resolve the conflict. This enforcement prevents the interface from propagating through the type system with an unresolved incompatibility.

The intersection creates a type where id is string & number, which simplifies to never because no value can simultaneously be both types. The compiler permits the type definition but rejects assignments. The validation occurs at use time, not declaration time.

The implication here is that intersection types allow incompatible structures to exist in the codebase until code attempts to use them. In large applications with hundreds of types, this delayed validation obscures which types are actually usable. Developers discover incompatibilities only when they attempt to construct values, often far from the type definition itself.

The handling of property conflicts reveals why interface extension and intersection types are not interchangeable. When a child interface attempts to override a parent property with an incompatible type, extends produces a clear error at the declaration. The compiler message identifies the conflicting property and the incompatible types, directing developers to the exact location requiring attention.

Intersection types handle conflicts differently. For primitive type conflicts, the compiler creates a union type that resolves to never. For object type conflicts, the compiler merges properties recursively. This behavior permits structural inconsistencies that only surface when code attempts to satisfy the intersection constraints.

Consider a common API response scenario. A base response interface defines common fields, and specific endpoints add domain-specific properties:

With extends, the narrowing of data from unknown to a specific object type is valid because the specific type satisfies the unknown constraint. The compiler permits this refinement. Attempts to widen the type or introduce an incompatible type produce errors:

The error is immediate and specific. Developers see which property conflicts and what types are incompatible.

The InvalidResponseIntersection type compiles without error. The status property becomes number & string, which simplifies to never. Code that attempts to create values of this type fails, but the type definition itself is valid. This separation between definition validity and usage validity complicates type system reasoning.

Want to discuss this further?

Book a free strategy call with our team to see how these insights apply to your specific business goals.

Book a consultation