4 ms·
TypeScript seems to do structural typing for classes too: https://www.typescriptlang.org/play/#src=class%20Foo%20%7B%0D%0A%20%20field%3A%20string%20%3D%20''%3B%
by rictic 8y ago
TypeScript seems to do structural typing for classes too: https://www.typescriptlang.org/play/#src=class%20Foo%20%7B%0D%0A%20%20field%3A%20string%20%3D%20''%3B%0D%0A%7D%0D%0A%0D%0Aclass%20Bar%20%7B%0D%0A%20%20field%3A%20string%20%3D%20''%3B%0D%0A%7D%0D%0A%0D%0Alet%20foo%3A%20Foo%3B%0D%0Afoo%20%3D%20new%20Foo()%3B%0D%0Afoo%20%3D%20new%20Bar()%3B%0D%0A https://www.typescriptlang.org/play/#src=class%20Foo%20%7B%0...