Comment

Comment by culi

This post is trying to solve a problem you should never have to solve. The function in the post:

  const cast = <A, B,>(a: A): B => a as unknown as B;
should never be used in a professional codebase. The post even admits (though, in my opinion, understates) as much:

> If you're holding it right, these things don't come up, and your code genuinely is much much safer than if you used raw Javascript.

Just wanted to highlight this point I feel needs to be underscored

parent culi 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton