NISHIO Hirokazu[Translate]
構造を変えれば区別できる
ts
class Vec4d { x=0; y=0; z=0; w=0; } class Queartanion { x=0; y=0; z=0; w=0; } let x = new Vec4d(); const y = new Queartanion(); x = y; // OK

ts
class Vec4d { x=0; y=0; z=0; w=0; isVector=true; } class Queartanion { x=0; y=0; z=0; w=0; isQueartanion=true; } let x = new Vec4d(); const y = new Queartanion(); x = y; // Property 'isVector' is missing in type 'Queartanion' but required in type 'Vec4d'.

python
class Vec4 { x=0; y=0; z=0; w=0; } class Queartanion { s=0; x=0; y=0; z=0; } let x = new Vec4(); const y = new Queartanion(); x = y; // Property 'w' is missing in type 'Queartanion' but required in type 'Vec4'.

"Engineer's way of creating knowledge" the English version of my book is now available on [Engineer's way of creating knowledge]

(C)NISHIO Hirokazu / Converted from [Scrapbox] at [Edit]