TypeScriptとStructural Typing
code:typescript
class A { x: any }
class B { x: any }
const a: A = new B(); // OK: A and B are structurally type compatible
code:typescript
class A { private x: any }
class B { private x: any }
const a: A = new B(); // Error