What is the difference between ‘interface’ declaration merging and type alias intersection when both add the same property with incompatible types?

TypeScript Professional Hard

TypeScript Professional — Hard

What is the difference between ‘interface’ declaration merging and type alias intersection when both add the same property with incompatible types?

Key points

  • Interface merging creates an intersection of declarations
  • Conflicting property types result in 'never'
  • Type alias intersection behaves similarly
  • Both handle incompatible types by producing 'never'

Ready to go further?

Related questions