4 ms·
It's worth noting that this (good) example is unrelated to unsoundness, too -- it's related to built-in APIs using 'any'. Within Google we include a "strict" d
by evmar 6y ago
It's worth noting that this (good) example is unrelated to unsoundness, too -- it's related to built-in APIs using 'any'.
Within Google we include a "strict" d.ts in every compilation that shadows this API (and one other) with one that instead returns "unknown". We have talked about going through the whole TS API and removing all the 'any' in this manner for this reason.
- joshAg 6y agoThat's a great idea! What's the other built-in that you shadow?
- evmar 6y agoThe definition of `new Map`: https://www.typescriptlang.org/play?#code/FDDGHsDsGcBcAJrwLz0gUwO7wMrtgBQCUA3PPAPQW74A8ArpANaTiaQB8ANIgIYBm6MFDjwAtijRZ4AWV4AHYmUrU582r0gBPHpq3d4jaAPQBCYEA https://www.typescriptlang.org/play?#code/FDDGHsDsGcBcAJrwLz... (I still think this is actually due to bug in TypeScript, see https://github.com/microsoft/TypeScript/issues/31990 https://github.com/microsoft/TypeScript/issues/31990 .)