Hacker News new | ask | show | jobs
by auggierose 166 days ago
Yes, I am wondering if opaque types would be difficult to implement somehow in TypeScript? It should really be part of TypeScript if at all reasonably possible.
1 comments

I'm not that familiar with the TS internals. They'd have to add a keyword to the language which could break stuff. The smart move would be to reserve the `opaque` word a few versions in advance of introducing the feature that gives it a meaning
I don't think the keyword is the problem, I am wondering more about the internals of their type inference algorithm.