Reputation: 101
Say my function f takes an argument, x, of type string. But not any string, only strings of length n.
Is it possible to enforce this using the type system?
Upvotes: 4
Views: 1495
Reputation: 31600
No, it is not possible to do this in Typescript as types.
Upvotes: 2