TS2430

Interface 'StockExchange' incorrectly extends interface 'Exchange'.

Broken Code ❌

interface Exchange {
  address: string;
}
 
export interface StockExchange extends Exchange {
  address?: string;
}

Fixed Code ✔

The address in Exchange is a mandatory property but in StockExchange it is declared as being optional which creates an incompatibility in the type. To fix the error, the property address has either to become optional or mandatory in both declarations:

interface Exchange {
  address: string;
}
 
export interface StockExchange extends Exchange {
  address?: string;
}