Skip to content
Advertisement

Why doesn’t TypeScript complain about interface violations resulting from Object.create?

JavaScript

Why do f and j pass type-checking? Is it possible to configure TypeScript so that h passes type-checking but f and j fail?

Advertisement

Answer

Object.create is designed to return any by Typescript. There has been an issue in Typescript’s Github repository but it’s closed and they do not intend to change it soon.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement