News for hackers. Stuff that matters.
Re:TypeScript’s quirks: How inconsistencies make the languag... by redmorphium on Saturday February 01, 2020 @07:29AM (#22210165)
From your second link:

https://en.wikipedia.org/wiki/Duck_typing#Structural_type_sy...

> Duck typing is similar to, but distinct from structural typing. Structural typing is a static typing system that determines type compatibility and equivalence by a type's structure, whereas duck typing is dynamic and determines type compatibility by only that part of a type's structure that is accessed during run time.

Re:TypeScript’s quirks: How inconsistencies make the languag... by kazinator on Tuesday February 04, 2020 @12:21AM (#22232662)
That looks like ooks like "original research". It's obvious that what is described as dynamic-only duck typing could be statically checked. So that is to say, a given expression foo.bar in the program could be statically checked to make sure that all possible values that foo takes on have property bar. If three classes A, B, C in the program have property foo, then this means verifying that foo is A | B | C. Thus, "static duck typing".