logoalt Hacker News

arein3 • today at 5:58 PM • 2 replies • view on HN

A sharp edge is writing meta typesystem code infolving covariance, invariance etc

Saw that in a typescript repository

It's ok when it's part of a very specific library, it's not ok using it as part of usual project code


Replies

jayd16 • today at 6:15 PM

What is the significant difference to Java? In C# you would write something like Foo<out Bar> instead of Foo<? extends Bar> or some such thing.

➕ show 1 reply
afdbcreid • today at 7:32 PM

> A sharp edge is writing meta typesystem code infolving covariance, invariance etc

Like in Java? C# has its own sharp edges (like most or all languages), but it's almost disingenuous to bring a feature that is much more complex and weird in Java as an example.