Is there a way to generate a compile-time error if an argument is provided without being 'casted' as `const` in TypeScript? In the example code below, the array is converted into a `readonly` array:
function myFunc<T extends string[]>(arr: T): T {
return arr;
}
const a = myFunc(["koo"] as const);
// Good, `a` is now `const a: ["koo"]`
// Should work
const b = myFunc(["koo"]);
// Bad, `b` is now `string[]`
// Should throw, something like:
// TypeScript error: Argument of type 'string[]' is not assignable to parameter of type 'readonly string[]'