I have.
It's when you do
const dir = "up"; // TS infers type "string"
test(dir); // error
For mutable variables (let/var), you usually want TS to infer `string` in the first line. IMO the fact that they also infer `string` for constants is a design flaw, that I hope will one day be fixed.They recently added a feature to make this less painful:
const dir = "up" as const;
test(dir); // works
That's the same as `as "up"` bit without having to duplicate the string.