logoalt Hacker News

saghmyesterday at 3:26 PM1 replyview on HN

That's because it's structurally typed (as opposed to nominally typed). I don't happen to prefer it, but I don't think it's fair to conflate that with unsoundness like the example given above; it's totally possible to have a sound structural type system. TypeScript doesn't happen to be sound, but it's not because of that.


Replies

teaearlgraycoldyesterday at 5:54 PM

Structural typing is great. It's the verified version of duck typing.

show 1 reply