TypeScriptとStructural Typing
#typescript
https://github.com/Microsoft/TypeScript/wiki/FAQ#when-and-why-are-classes-nominal
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